Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

y do my leaderstats not show up in game?

Asked by 4 years ago
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

Log in to vote
1
Answered by 4 years ago

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)
0
Hope this helps! alexfinger21 341 — 4y
0
Thz kier1664 9 — 4y
Ad

Answer this question