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

How can i clone the players character into ServerStorage?

I've been trying to :Clone() the Players Character into ServerStorage but i cannot get it to work? It is in a Local script in the player.

local Player = game.Players.LocalPlayer
local CHR = Player.Character
local CHRclo = CHR:Clone()
CHRclo.Parent = game.ServerStorage

1 answer

✓ Accepted answer

The Archivable property of a Player prevents you from cloning it. You need to disable it first before cloning the character and then re-enable it back to its default property of false. I also added in a repeat until loop so that both the character and player load first before you try cloning the character. This is a common bug when running the script outside of studio. Also, in case you haven't used it, please post output of the script. You should've gotten an attempt to access nil value error which can narrow down where the bug is. To open the output window in studio go to view>output(one of the smaller buttons to the right of properties and explorer)

local Player, CHR

repeat
	wait(.5)
	Player = game.Players.LocalPlayer
	CHR = Player.Character
until
	(Player ~= nil) and (CHR ~= nil) --Wait for player and character to load

CHR.Archivable = true --Enabled Cloning
local CHRclo = CHR:Clone()
CHR.Archivable = false --Disable Cloning
CHRclo.Parent = game.ServerStorage

Wiki page: http://wiki.roblox.com/index.php?title=API:Class/Instance/Archivable

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