Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

leaderboards is not a valid member of Player "Players.luzgar_Y" pls help?

guys so im making a game where you have to buy something from the shop and i keep messing up the code and im tired already and i need help

game.Players.PlayerAdded:Connect(function(player)

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


local cash = Instance.new("IntValue",leaderstats)
cash.Name = "Gold"
cash.Value = 1000

end)

3 comments

0

Hi, the code works perfectly. I don't think you got enough sleep.

0

ok i ge it this means there must be something wronk in an other script?

0

https://developer.roblox.com/en-us/articles/Leaderboards just follow this and you'll get there

1 answer

Hello, have you referenced the "player" variable beforehand?

If not, try putting:

local players = game:GetService("Players")

This discussion is preserved as it was. New answers, comments, and votes are closed.