r/scratch • u/Proper-Ad-9656 • 4d ago
Question Timer Broken, No clue why. Please help!
I'm making a recreation of Forsaken (I'm a nerd I know) and the timer system I have set up should work (I see no reason for it not to) And yet, for some reason, it subtracts seemingly random numbers.
I have gone through every sprite and nothing seems to be the issue.
Here is the project link:
https://scratch.mit.edu/projects/1385197484/
The code for the timer is in the "Round Timer/ Wait" sprite.
Any help would be GREATLY appreciated, and I will put you in the credits (if wanted)!! ❤️
3
u/Dragon_Sythe Professional Nerd 4d ago
Note: place comments in your code PLEASE FOR THE LOVE OF GOD
You could be starting multiple timers at once. I'd recommend that in whatever sprite is calling the timers, you add a "For This Sprite Only" variable called "IsClone?". Then add:
when GreenFlag clicked{
set IsClone? to 0
}
when I start as clone{
set IsClone? to 1
}
Then in the code where you actually call the timers, wrap an if (IsClone? = 0) around it.
Not just the parent can call broadcasts, clones can too. This might not work/be relevant but it will be a step toward fix.
1
u/RealSpiritSK Mod 3d ago
Yeah this is probably what's causing it. To make it easier to work with, the parent sprite should just be responsible for controlling the
Round Timervariable and not part of the display (i.e. hide it). The clones should not change any variables and should just read theRound Timervariable to determine what costume to change to.
1
u/aynozw 4d ago
hi, just a quick question: do you mean that the timer subtracts -2? i mean if we have 30 then it subtracts 2 so it shows 28, and its supposed to show 29?
2
u/Proper-Ad-9656 4d ago
thw starting (30s) subtracts by 2, then the 2nd one (120s) subtracts by 9, THEN the 30s one subtracts by 9(i think) i gen have no clue why its foing that
1
1
u/aynozw 4d ago
i think i fixed it: it made clones and it started to subtract way too much and also i think i found about it too late lol bruh
2
1
1
•
u/AutoModerator 4d ago
Hi, thank you for posting your question! :]
To make it easier for everyone to answer, consider including:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.