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

My PlayerData Folder Creating Script not working?

Asked by 4 years ago

I tried to make a Folder where it will store all player Data such as Level, InGame, etc

But It doesnt work

Here is what I wrote

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)
    -- Create PlayerData Folder

    local PlayerDataF = Instance.new("Folder")
    PlayerDataF.Name = Player.Name
    PlayerDataF.Parent = script.Parent
end)

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Alright you made a simple error that is a common mistake some scripters do. so heres your script

local Players = game:GetService("Players")
local playerdata = game.ReplicatedStorage:WaitForChild("PlayerData")

Players.PlayerAdded:Connect(function(Player)
    -- Create PlayerData Folder

    local PlayerDataF = Instance.new("Folder")
    PlayerDataF.Name = Player.Name
    PlayerDataF.Parent = playerdata
end)

Alright I changed it up to how you want it. Accept if works or helps

0
Make sure to do capital P on Player cause thats how you stated it on the function DuckyRobIox 280 — 4y
Ad

Answer this question