Hello, I made a map system about a year ago now and it worked find until now?
this script is supposed to change the timer value but it dosent work?
local timer = 240
while true do
wait(1)
timer = timer - 1
script.Parent.TextButton.Text = "Next Obby In "..timer.. " "
if timer == 0 then
timer = 240
end
end
and this code is supposed to change witch map is currently showing?
while true do
local tower1 = game.ReplicatedStorage.Towers.Tower1:Clone()
tower1.Parent = game.Workspace
wait(240)
tower1:Destroy()
local tower2 = game.ReplicatedStorage.Towers.Tower2:Clone()
tower2.Parent = game.Workspace
wait(240)
--wait(2)
tower2:Destroy()
local tower3 = game.ReplicatedStorage.Towers.Tower3:Clone()
tower3.Parent = game.Workspace
wait(240)
--wait(2)
tower3:Destroy()
end
can someone tell me what has updated and no longer works in these?
First Script you used a timer variable but in the 2nd one you use a wait why not do the same thing you did in the first script to the 2nd one and there’s no syntax in ur script that’s outdated.
And also even if the script does work… the timer variable in the first script may start running 0.5 - 1 seconds before the wait runs which may cause a slight delay
Primary reason is that you are checking if the timer is 0 or not.
if timer == 0 then
timer = 240
end
Why is that?
Well, you cannot reliably believe in numbers to be exact. Reliability might be an issue in numbers where they tend to bump into floating-point errors. Use <= operator instead.