Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Armor isn't cloning on the player? HELP!

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by
WoTrox 345 Moderation Voter
3 years ago

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.

0
Thanks! It worked. :) coolkid222131 19 — 3y
Ad

Answer this question