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

Cloning a Mesh into a character?

Asked by
Mystdar 352 Moderation Voter
10 years ago

A normal script This is supposed to clone a mesh into a player's head, but it doesn't work, it removes the mesh and decal, just those two commented lines don't work.

local mesh = script.Parent.Mesh
function onTouched(hit)
    if hit.Parent:findFirstChild("Humanoid") ~= nil then --and hit.Parent:findFirstChild("Cape") == nil then
        local head = hit.Parent.Head
        head.Mesh:remove()
        local a = mesh:Clone() -- I believe the problem is around here
        a.Parent = head -- Everything else works.
        head.face:remove()
    end
end

script.Parent.Touched:connect(onTouched)

Thanks

Answer this question