game.Players.PlayerAdded:Connect(function()
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
✓ ANSWER ACCEPTED
(Answered!) It says "unknown global" where it says players, how can i fix it?
2 answers
✓ Accepted answer
You need to put 'player' as a parameter for the PlayerAdded event.
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
end)
You haven't actually determined who the player is from your script.
game.Players.PlayerAdded:Connect(function(Player)
local Leaderstats = Instance.new("Folder")
Leaderstats.Name = "Leaderstats"
Leaderstats.Parent = Player
end)
Hope this helps.
2 comments
0
thanks
0
Np.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
thank you!