Problem saving folders in players storage

Hello users I have the following problem: I am making a script to check my stuff and add objects to the player’s place, but when it comes to putting a folder in the player it will not be cloned there, any way to solve it?
The Scripts:

local ServerStorage = game:GetService(“ServerStorage”)
local PlayerValues = ServerStorage.PlayerValues

Players.PlayerAdded:Connect(function(playerstorage)

ServerStorage.PlayerValues:Clone().Parent = playerstorage

end)

Note: this is only a part of the script (because this is just where the problem is).

1 Like

Is this a server script or local script? Make sure it’s in the former, as it actually catches when a player joined a game, whereas the latter does not.

2 Likes

I forgot to mention this, yes it is a server script

2 Likes

Do you have any errors in the output? Perhaps the only problem I can see in this extract is that the PlayerValues doesn’t exist yet, so you should use WaitForChild for that

1 Like

I forgot to mention this, yes it is a server script

I’m always forgetting the waitforchild, thanks

local ServerStorage = game:GetService(“ServerStorage”)
local PlayerValues = ServerStorage:WaitForChild(“PlayerValues”)
local clone = ServerStorage.PlayerValues:Clone()
clone.Parent = playerstorage
end)

1 Like

I confess that this is the best way to check