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

How do i change a name of a leaderboard?

Asked by 10 years ago

Why won't it work?

if 2 + 2 ==4 then
game.Leaderboard.name = "Score"
end

The output brings up Leaderboard is not a valid member of DataModel.And i don't know what that means.Help!

1 answer

Log in to vote
2
Answered by
Seraine 103
10 years ago

The script doesn't recognise what "Leaderboard" means. Try this script:

function onPlayerEntered(newPlayer)

    local stats = Instance.new("IntValue")
    stats.Name = "leaderstats"

    local cash = Instance.new("IntValue")
    cash.Name = "Score"
    cash.Value = 0

    cash.Parent = stats
    stats.Parent = newPlayer
end

game.Players.ChildAdded:connect(onPlayerEntered)

Hope it helps !

Ad

Answer this question