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

Why doesn't the hats stay on the clone?

I've made an adminish gui which allows the player to clone themselves, however, everything clones but the hats fall through the clone and disappear instead of just staying on their heads.. Any ideas?

local Player = game.Players.LocalPlayer 
local Mouse = Player:GetMouse() 



script.Parent.Parent.Parent.MouseButton1Click:connect(function()
	local message = script.Parent.Parent.Parent.Parent.Cmd.Text
	
	function findPlayer(name)
    for _, player in ipairs(game.Players:GetPlayers()) do
        if player.Name:lower() == name:lower() then
            return player
        end
    end
end

	
	if message:sub(1, 6) == "clone/" then
		if message:sub(7) == "me" then
			L = game.Players.LocalPlayer
			
			S = Instance.new("StringValue")
	S.Value = ("Clone")
	S.Parent = L.Character.Torso
	
	
	
	B = L.Character
			B.Archivable = true
			B:Clone().Parent = workspace
			
			
			L.Character.Torso.Value:Remove()
			
			
			
		
    end
	end
end)



	
	
	
	
	game.Players.PlayerAdded:connect(function(player)
	
end)










2 answers

✓ Accepted answer

Hey :3

So, i'm not sure what your overall thing your going for but lets fix the issue your having :33

First i want to wait for my character to spawn in

workspace:WaitForChild("DanzLua")

Next lets turn on Archivable so :Clone() can copy it and lets go ahead and clone it too

workspace.DanzLua.Archivable=true
local clone=workspace.DanzLua:Clone()

Really all we would need to do next would be to parent the clone to something but I want to make him go above the original character cause why not

if clone:FindFirstChild("Torso")~=nil then clone.Torso.CFrame=clone.Torso.CFrame+Vector3.new(0,3,0)
elseif clone:FindFirstChild("UpperTorso")~=nil then clone.UpperTorso.CFrame=clone.UpperTorso.CFrame+Vector3.new(0,3,0)
end

I made him go up by 3 studs :333

Ok, now all that's left is to parent him

clone.Parent=workspace

Our final script

workspace:WaitForChild("DanzLua")

workspace.DanzLua.Archivable=true
local clone=workspace.DanzLua:Clone()

if clone:FindFirstChild("Torso")~=nil then clone.Torso.CFrame=clone.Torso.CFrame+Vector3.new(0,3,0)
elseif clone:FindFirstChild("UpperTorso")~=nil then clone.UpperTorso.CFrame=clone.UpperTorso.CFrame+Vector3.new(0,3,0)
end
	
clone.Parent=workspace

Enjoy :333333

Chances are your hat has it's CanCollide false (unchecked)

That's all, I will show you some stuff you can change in your script

you can add a new variable

local button = script.Parent.Parent.Parent

Then you can go to line 06 and change script.Parent.Parent.Parent with button.MouseButton1Down

That's all I can help,

Upvote and accept answer if helped!

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