Please tell me what is wrong with this script. I also want to know how to make the TextButton not visable.
function onClick() while true do game.Players.LocalPlayer.leaderstats.Score.Value = game.Players.LocalPlayer.leaderstats.Score.Value + 1 local str = game.Players.LocalPlayer.leaderstats.Score.Value local str1 = "Your income: " game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextLabel.Text = str1..str game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.TextButton.Visable = false wait(1) end end script.Parent.TextButton.MouseButton1Click:connect(onClick)
There is this weird thing for local scripts, that you have to put wait(0.1)
at beginning of the code. You might be able to use smaller wait time, but I haven't experimented with it too much, so I stick to using 0.1 seconds.