How do I stop a GUI from reseting when a player resets?
So I have a textbutton that uses on click to give 1 point every 3 seconds:
02 | if game.Players.LocalPlayer.leaderstats.Score.Value > = 100 then |
03 | script.Parent.Visible = false |
05 | game.Players.LocalPlayer.leaderstats.Score.Value = game.Players.LocalPlayer.leaderstats.Score.Value + 1 |
06 | local str = game.Players.LocalPlayer.leaderstats.Score.Value |
07 | local str 1 = "Your income: " |
08 | game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Cashincome.Text = str 1.. str |
14 | script.Parent.MouseButton 1 Click:connect(onClick) |
This works great but when I reset it stops the while loop and makes the GUI visible again. How do I stop it from doing this?