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

y do my leaderstats not show up in game?

local serverStorage = game:GetService("ServerStorage")

game.Players.PlayerAdded:Connect(function()
	
	local Leaderstats = Instance.new("Folder")
	Leaderstats.Name = "leaderstats"
	Leaderstats.Parent = plyer 
	
	local Strength = Instance.new("NumberValue")
	Strength.Name = "Strength"
	Strength.Parent = Leaderstats
	
	
local dataFolder = Instance.new("Folder")
dataFolder.Name = plyer.Name
dataFolder.Parent = game.ServerStorage.RemoteData


local debounce = Instance.new("BoolValue")
debounce.Name = "Debounce"
debounce.Parent = dataFolder

end)

1 answer

✓ Accepted answer

Hello, you basically forgot the player in your script. Here is the fix:


local serverStorage = game:GetService("ServerStorage")

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

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

    local Strength = Instance.new("NumberValue")
    Strength.Name = "Strength"
    Strength.Parent = Leaderstats


local dataFolder = Instance.new("Folder")
dataFolder.Name = plyer.Name
dataFolder.Parent = game.ServerStorage.RemoteData


local debounce = Instance.new("BoolValue")
debounce.Name = "Debounce"
debounce.Parent = dataFolder

end)

2 comments

0

Hope this helps!

0

Thz

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