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

My script isn't functioning as I intend it to?

I bet the answer is super simple but here it is:

game.Players.PlayerAdded(function(player)
	
	local leaderstats = Instance.new("Folder",player)
	leaderstats.name = "leaderstats"
	
	local Level = Instance.new("IntValue", leaderstats)
	Level.name = "Level"
	
end)

1 answer

✓ Accepted answer

When posting, you should describe the issue you are having in detail, and also describe anything you have tried to fix the issue.

By looking at your code, there doesn't seem to be anything wrong at first, but I do notice you are missing a :Connect()

Here's how to fix it:

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

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

    local Level = Instance.new("IntValue", leaderstats)
    Level.name = "Level"

end)

1 comment

0

Thanks!

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