I am making a entermession and the varible for the entermession wont change.
01 | game.Players.PlayerAdded:Connect( function (player) |
02 |
03 | while true do |
04 | wait() |
05 | if game.ServerScriptService.System.Action.Value = = 1 then |
06 | game.ServerScriptService.System.works.Value = false |
07 | game.ServerScriptService.System.Action.Value = 0 |
08 | local time = 20 |
09 | while time > = 0 do |
10 |
11 | print ( "Entermession: " ..time) |
12 | player.PlayerGui.wordy.TextLabel.Visible = true |
13 | player.PlayerGui.wordy.TextLabel.Text = "Entermession: " ..time |
14 | local time = time - 1 -- I feel like it is here but this code has no error. |
15 | wait( 1 ) |
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).
1 | -- declare the variable with this |
2 | local time = 20 |
3 | -- and change it with this |
4 | time = time - 1 |