Ad
Log in to vote
0

Leaderboard fail, need help?

Asked by 7 years ago

I am making a tycoon with a leaderboard for cash.

-- leaderboard made by roboy5857

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

    local Moneyz = Instance.new("IntValue")
    Moneyz.Name = "Moneyzz"
    Moneyz.Value = 5

    Moneyz.Parent = stats
end

It won't work, why?

1 answer

Log in to vote
1
Answered by
Mauvn 100
7 years ago

Try this instead.

function onPlayerEntered(newPlayer)

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

    local cash = Instance.new("IntValue")
    cash.Name = "Moneyzz"
    cash.Value = 5

    cash.Parent = stats
    stats.Parent = newPlayer
end



game.Players.ChildAdded:connect(onPlayerEntered)
--You forgot to connect the function like this above

Please note: That if you don't connect a function it's pretty much useless and it wouldn't work.

Ad

Answer this question