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

My PlayerData Folder Creating Script not working?

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

✓ Accepted answer

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

1 comment

0

Make sure to do capital P on Player cause thats how you stated it on the function

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