Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to I print a player's money balance?

Asked by 5 years ago

Hello, I am having trouble with a Server Script that I am doing, it is a Regular script and I keep getting an error like, "leaderstats is not a valid member of Player". It would be appreciated if you would be able to find the error, and by the way, do not recommend the Scripting Helper's discord.

game.Players.PlayerAdded:Connect(function(Plr)
    print(Plr.Name.. " has empty data!")
    print(Plr.Name.. " Has loaded in!")
    print(Plr.Name.. "'s balance is $"..Plr.leaderstats.Cash.Value)
end)
0
try doing Plr:FindFirstChild("leaderstats").Cash.Value kom297 -4 — 5y
0
Start the game on Studio, and then open the player folder, look inside your player, and check the object that is used for leaderstats cailir 284 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
game.Players.PlayerAdded:Connect(function(Plr)
    print(Plr.Name.. " has empty data!")
    print(Plr.Name.. " Has loaded in!")
    print(Plr.Name.. "'s balance is $"..Plr:WaitForChild("leaderstats"):WaitForChild("Cash").Value)
end)
Ad

Answer this question