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

My leaderstats doesn't work outside studio, how can I fix that?

game.Players.PlayerAdded:Connect(function(player)
	
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	local stages = Instance.new("IntValue")
	stages.Name = "Stages"
	stages.Parent = leaderstats
	
	local rebirths = Instance.new("IntValue")
	rebirths.Name = "Rebirths"
	rebirths.Parent = leaderstats
	
end)

This code will work in Roblox Studio but it doesn't work outside Roblox Studio. Please help. Thank you!

1 comment

0

help

1 answer

this is the awnser:

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

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

    local stages = Instance.new("IntValue")
    stages.Name = "Stages"
    stages.Parent = leaderstats

    local rebirths = Instance.new("IntValue")
    rebirths.Name = "Rebirths"
    rebirths.Parent = leaderstats

end)

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