So I have this tycoon I made, and I am trying to add a gui that shows how much money I have(instead of using leaderboards), but it does not work, and I do not recieve any errors! Please help if you can. Thanks in advance.

wait(2)
game.Players.PlayerAdded:connect(function(player)
	local cash = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
	if player ~= nil then
		repeat script.Parent.Text = "$ "..cash.Value
		until player == nil	
	end	
end)

1 comment

0

First of all, you're doing this completly wrong. Second of all you shouldn't put a loop like that in a PlayerAdded event.