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

Armor isn't cloning on the player? HELP!

So I've been trying to clone armor on a player. But whenever I touch the button, It clones to the workspace but removes every mesh in the armor. It goes to the position of the player but is completely transparent. I'm very, very, very new to scripting so please don't bully me. It's a regular script. Here it is.

local daddy = false 

function Touch(part)
	if daddy == false then
	daddy = true
	local hum = part.Parent:FindFirstChild("HumanoidRootPart")
	print("?")
		local pos = hum.CFrame
	local e = game.ReplicatedStorage.ArmorModel:Clone()
	print("w")
		e.Parent = game.Workspace
	e.WorldPivot = CFrame.new(pos.Position)
	e.Name = "Steller"
	print("???")
	end
end

script.Parent.Head.Touched:Connect(Touch)

1 answer

✓ Accepted answer

First off, assign a PrimaryPart to the model: Go to the model, and at the Pivot section set the PrimaryPart to a part inside the model (a part you want to be the "center" of the whole model). After this, you can set this PrimaryPart's position to whatever you want, and the model will follow it.

local daddy = false 

function Touch(part)
    if daddy == false then
    daddy = true
    local hum = part.Parent:FindFirstChild("HumanoidRootPart")
        local pos = hum.CFrame
    local e = game.ReplicatedStorage.ArmorModel:Clone()
        e.Parent = game.Workspace
    e.PrimaryPartPosition = pos --Setting the PrimaryPartPosition will move the whole model
    e.Name = "Steller"
    end
end

script.Parent.Head.Touched:Connect(Touch)

This will move the model, but it won't make it follow the player, only move it once.

1 comment

0

Thanks! It worked. :)

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