I create a money system. It's called "Outfit", it's located in game.Players.LocalPlayers. And the value for it is called cash. And the script below is what happens next however when I enter test mode an error showed up about the script been running for too long. And I got no idea how to solve this problem!! I tried but never succeed it's kept on popping up and now all my scripts are effected. I used the wait() but it never solve the problem.
while true do wait() if game.Players.LocalPlayer:findFirstChild("Outfit") then wait() script.Parent.Text = "$"..game.Players.LocalPlayer.Outfit.cash.Value end wait() end
I don't really know how to solve this problem, but you could Instead of using the wait() function inside the loop, you could do this instead:
while wait() do if game.Players.LocalPlayer:findFirstChild("Outfit") then script.Parent.Text = "$"..game.Players.LocalPlayer.Outfit.cash.Value end end
Also, make sure the script is a LocalScript and is running inside the player or player's character.
It's Because it keeps Finding The "OutFit" and Doing it again and again.