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

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

Asked by 2 years ago
Edited 2 years ago

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)

0
Hi, the code works perfectly. I don't think you got enough sleep. rizdoesntlikeyou 0 — 2y
0
ok i ge it this means there must be something wronk in an other script? luzgar_Y 0 — 2y
0
https://developer.roblox.com/en-us/articles/Leaderboards just follow this and you'll get there Miniller 562 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

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

If not, try putting:

local players = game:GetService("Players")
Ad

Answer this question