I am using PlayerAdded to show the amount of money you have, however if you die and respawn the amount does not load unless you withdraw or deposit money.
because a player isnβt added, the player stays there until the user leaves the game, it is forever in Players
PlayerAdded works whenever player joins the game.
You can use CharacterAdded whenever the player character added (When player dies the character respawns and triggers the characterAdded function)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
-- Code here
end)
end)
You can use plr.CharacterAdded:Wait()
too.
When the user joins, a Player is added to game.Players.
The instance will stay there until the user leaves the game.
Iβve just tried it and, it still just makes the UI say $0.
Mention the codeβ β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
Show the UI script so we can understand the problem
Disable .ResetOnSpawn for the Gui
and use .CharacterAdded not Playeradded
local value = -- path to value.
value:GetPropertyChangeSignal("Value"):Connect(function)
-- set the value.
end)