in my project when you kill all the zombies the variable keeps going up and I dont know why the link to my projects is http://scratch.mit.edu/projects/4lover/1973370 and if you could download it and tell me whats wrong it would be appreciated
Offline
with what i saw it appears you just set the veriable it doest seem you told it when to increase
Offline
Well i said that when one of the zombies dies it broadcasts a code and when the variable recieves the code it increases by one but instead when I kill a zombie it keeps increasing forever
Offline
4lover wrote:
Well i said that when one of the zombies dies it broadcasts a code and when the variable recieves the code it increases by one but instead when I kill a zombie it keeps increasing forever
Try doing this:
When I Recieve whatever
forever
set variable to variable + 1
stop script
I don't know if it'll work though...
Offline
nope it doesnt work
Offline
Thescratch3 wrote:
4lover wrote:
Well i said that when one of the zombies dies it broadcasts a code and when the variable recieves the code it increases by one but instead when I kill a zombie it keeps increasing forever
Try doing this:
When I Recieve whatever
forever
set variable to variable + 1
stop script
I don't know if it'll work though...
That will just stop that script. Evidently the message is being broadcast over and over again, so you should look at yours scripts to make sure there's nothing that will keep looping and sending it out.
For example, you may have a script that sends a message when it's touching something, like this:
When green flag clicked forever if <touching sprite2> broadcast [message]
This will cause the variable to increase rapidly because as long as it's touching the sprite, it will send the message repeatedly. You can fix this by modifying the script like this:
When green flag clicked forever if <touching sprite2> broadcast [message] and wait wait until not <touching sprite2>
Offline
nope it still doesnt work I think you guys miht be able to find the probelem if you look at my project here:http://scratch.mit.edu/projects/4lover/1973370
Offline
hmm try getting rid of the brodcastand set it up like this i think it might work
when sprite touches sprite increase deaths by 1 wait untill not touching sprite
Offline
how do you make the not touching sprite part?
Offline
under operator thier not and under sencing is touching
Offline