Timed Shoot and NoShoot button
nizzar27
Member Posts: 8
Hi
I have a button that has two images 1 is for shooting 2 is for not shooting (limiting players rate of fire)
It should work like this - When i press actor then it should shoot once and change image to noshoot. when image noshoot is up you cant shoot. after timer elapses change back image to shoot, so u can shoot again..... and so on
CODE IN Shoot button
RULE
If touch is pressed & Self.Image is Shoot
DO
spawn shoot actor
change image to NoShoot
END
RULE
Self.Image is NoShoot
DO
Timer->change image to Shoot
END
Result of this is I keep pressing the button and nothing happens
Please help
plsssss
I have a button that has two images 1 is for shooting 2 is for not shooting (limiting players rate of fire)
It should work like this - When i press actor then it should shoot once and change image to noshoot. when image noshoot is up you cant shoot. after timer elapses change back image to shoot, so u can shoot again..... and so on
CODE IN Shoot button
RULE
If touch is pressed & Self.Image is Shoot
DO
spawn shoot actor
change image to NoShoot
END
RULE
Self.Image is NoShoot
DO
Timer->change image to Shoot
END
Result of this is I keep pressing the button and nothing happens
Please help
plsssss
Comments
What is the exact Timer set up you have? Have you tried checking Run to Completion?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
So I have created a variable canshoot - boolean
and replaced the if image to if canshoot
now its working but idk why wasnt the image thing working
thx >-
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User