I am making a entermession and the varible for the entermession wont change.
game.Players.PlayerAdded:Connect(function(player) while true do wait() if game.ServerScriptService.System.Action.Value == 1 then game.ServerScriptService.System.works.Value = false game.ServerScriptService.System.Action.Value = 0 local time = 20 while time >= 0 do print("Entermession: "..time) player.PlayerGui.wordy.TextLabel.Visible = true player.PlayerGui.wordy.TextLabel.Text = "Entermession: "..time local time = time - 1 -- I feel like it is here but this code has no error. wait(1) end while time == -1 do player.ServerScriptService.System.works.Value = true local time = false player.PlayerGui.wordy.TextLabel.Visible = false end end end end)
Instead of changing the value of the variable, you declare it again in line 14 by putting "local" before it. (meaning, it can't set itself to itself because it doesn't know what it is, if that makes sense).
-- declare the variable with this local time = 20 -- and change it with this time = time - 1