Hello all! Just looking to see if there’s any bugs in my code I can clear here, or if it’s an issue somewhere else, all help appreciated! ![]()
- What do you want to achieve? Keep it simple and clear!
I’m adding a countdown and TextLabel into my tower game, and I’m currently having issues with my script, so I’m checking here if it’s just here or if there’s an issue in my script elsewhere!
- What is the issue? Include screenshots / videos if possible!
function countdown()
local status = game.ReplicatedStorage.Status
local GameLength = 60
for i = GameLength,0,-1 do
status.Value = "There is "..GameLength.." seconds left."
if GameLength == 0 then
plr:LoadCharacter()
wait(1)
end
end
end
This script is supposed to count down from 60 to 0, but instead it starts the function and ends it instantly, and my TextLabel doesn’t change. I don’t know if there’s a way for when it gets to 0 that you can possibly continue the script, since my tower game script is a while true do loop, but if there is that might be the problem.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I did a quick skim over the developer hub, but there’s not much as I’ve seen related to my script’s base.
Any help on this topic would be amazing, thank you for reading and have a great day! ![]()