Hi, i've a Local Script that controls time display and gui animation when there is extra added time or the game ends. Anyway the time script is controlled by server script ( to display the same time for everyone ). The problem is that the local script isn't doing the while true do part.
Local Script:
local added = game.Workspace.Time.Added.Value
local waitsecs = game.Workspace.Time.Wait.Value
local min = game.Workspace.Time.Minutes.Value
local sec = game.Workspace.Time.Seconds.Value
local randomsec = game.Workspace.Time.Wait.Value
game.Workspace.Time.Changed:Connect(function()
script.Parent.Purple.Time.Text.Text = game.Workspace.Time.Value
end)
while true do
wait(waitsecs)
print("Check") -- Checking if the main While loop is working
if min == 45 and sec >= 10 then
print("Extra") -- Checking if the If statement is running or not but it isn't
script.Parent.AddedTime.Disabled = false
script.Parent.Purple.Time.Added.AddedT.Text = "+" .. added .. "'"
script.Parent.Purple.AddedTimeValue.Text = "+" .. added .. "'"
end
if min == 45 + added and sec >= randomsec then
print("End")
wait(2)
script.Parent.OutAnimation.Disabled = false
script.Parent.InAnimation.Disabled = true
wait(.8)
break
end
end

2 comments
Well that works, i forgot that the min's won't update. As well as randomsec and waitsecs aren't the same values i just defined them wrong. Thanks again
It's better to use 'while wait() do' instead of 'while true do' or roblox will kill your script