J
Jdown79
Guest
Hey guys,
I'm trying to make a toggle variable, so that when you click once, it turns the variable on, and then if you click again, its off, so on, so forth.
However the script I have made has stopped function of everything, and I'm not sure if I'm on the right path to getting this working.
The variable I'm trying to toggle is global.tieroneequipped, from 0 to 1
Thanks in advance
I'm trying to make a toggle variable, so that when you click once, it turns the variable on, and then if you click again, its off, so on, so forth.
However the script I have made has stopped function of everything, and I'm not sure if I'm on the right path to getting this working.
The variable I'm trying to toggle is global.tieroneequipped, from 0 to 1
Thanks in advance
Code:
if global.tieronepurchased = 1
{
if distance_to_point(mouse_x,mouse_y) <=0
{
if mouse_check_button(mb_left)
{
global.tieroneequipped = 1
image_index = gunequipped;
}
}
}
if global.tieroneequipped = 1
{
if distance_to_point(mouse_x,mouse_y) <=0
{
if mouse_check_button(mb_left)
{
global.tieroneequipped = 0;
image_index = gun;
}
}
}