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

(Answered!) It says "unknown global" where it says players, how can i fix it?

game.Players.PlayerAdded:Connect(function()
	
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

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)

1 comment

0

thank you!

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.