How to Parent a Character into a Folder

This code doesn’t work, but the title explains the purpose.

Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
    	        character.Parent = game.Workspace.Folder
	end)
end)

what type of script is it?

(30 charrrsssss)

It might be because the Character model when inserted is not Archivable, therefore trying to set its parent does not work. Try turn archivable off and then Parent.

https://developer.roblox.com/en-us/api-reference/property/Instance/Archivable

its a serverscript not a client script.

This didn’t work but here is something interesting I found, if I wait for a few seconds before parenting it, it works, is there a way to do it without a wait.

Ok After a bit of testing this is now the code

Players = game:GetService("Players")
RunService =game:GetService("RunService")
Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
                RunService.Stepped:wait()
    	        character.Parent = game.Workspace.Folder
	end)
end)
12 Likes