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

why is it not showing up in the leader board?

Asked by 3 years ago
local players = game:GetService("Players")

players.PlayerAdded:connect(function(players)
    if players then 
        local folder = Instance.new("Folder")
        folder.Name = "leaderstats" 
        folder.Parent = players
        local Coins = Instance.new("IntValue")
        Coins.name = "Coins"
        Coins.Parent = folder
        Coins.value = 125
    end
end)
0
change the argument in the function to just "player", and change the parent of the folder to "player" spunargar -6 — 3y
0
You shouldn't have 2 same variables/parameters. You set players value to both the player (parameter) that joined and the service JustinWe12 723 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

You have some spelling mistakes thats why it doesnt work, this should work!

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)

    local folder = Instance.new("Folder")
    folder.Parent = player
    folder.Name = "leaderstats"

    local Coins = Instance.new("IntValue")
    Coins.Parent = folder
    Coins.Name = "Coins"
    Coins.Value = 125

end)

Read more here: https://developer.roblox.com/en-us/articles/Leaderboards

Ad

Answer this question