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

Issue with leaderstats?

Asked by 9 years ago
game.Players.PlayerAdded:connect(function(player)

    stats = Instance.new("IntValue", player)
    stats.Name = "leaderstats"

    money = Instance.new("IntValue", stats)
    money.Name = "Money"

    kills = Instance.new("IntValue",stats)
    kills.Name = "Kills"

    died = Instance.new("IntValue", stats)
    died.Name = "Deaths"

end)

I'm trying to create a leaderboard with money, kills, and deaths. Bizarrely it only loads Money. Any ideas?

0
Script works fine. Might I suggest making the variables local though? M39a9am3R 3210 — 9y

1 answer

Log in to vote
0
Answered by
Andorks 23
9 years ago

When I tried this script, it worked fine. I don't see anything wrong with it. I'd suggest when you do variables, do local variables. Example:

local money = game.Workspace.Money

The method you are using sometimes confuses your self or others. I suggest using the local.

Ad

Answer this question