M
mahmoud30pro
Guest
i have this 2 variables
I want player can upgrade gun lvl like that
if player have 50 gold he can buy lvl 1 gun and lost 50 gold
if player have 100 gold he can buy lvl 2 gun and lost 100 gold
And like that i did that code
The problem is if player have more than 100 gold and didn't upgrade any thing , When i click on upgrade boutton it's automatic set variable gun to 2 without break !!!
What i do ??
Code:
global.gun
global.gold
if player have 50 gold he can buy lvl 1 gun and lost 50 gold
if player have 100 gold he can buy lvl 2 gun and lost 100 gold
And like that i did that code
Code:
if global.gun = 0 and global.gun>50
{global.gold-=50
global.gun=1}
if global.gun = 1 and global.gun>100
{global.gold-=100
global.gun=2}
What i do ??