flash coding help ? if statement for upgrades?

lolagaging

New member
i am making a flash strategy game in as/2 but cant figure out an if statement for buying upgrades. i have set it so that "on button release" it will "+ 10" to my dynamic text boxes and take a certain amount of money from the money variable. i need to make it so that when the money amount is less that "10" you wont be able to purchase anything.
heres my code so far:
on (release){
gotoAndStop ("defecetower");
_root.townresource = _root.builddefencetowerresource - _root.builddefencetowerresource
_root.towndefence = _root.towndefence + 10
_root.money = _root.money - _root.builddefencetowerprice
}

all i need is an if statement i think please help
 
Back
Top