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

Morph Script Doesn't Give Desired Item? [closed]

Asked by
D3VRO 66
5 years ago

I'm currently helping someone out with the morph issue, because everytime a player attempts to morph it gives the players to clothing but not the armor or helmet. I've tried different ways of approaching this issue but none have worked. Every-time I pass on the morph button I check the output and it says that the Arm1, Arm2, Chest, etc.. is not a valid member of Model. The morph is mainly designed to morph to R6 which I set the game to be, but it won't allow me to have the armor and helmet. Can someone help me out?

Here is what the script for Arm1 looks like:

function onTouched(hit)
    if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("Arm1") == nil then
        local g = script.Parent.Parent.Arm1:Clone()
        g.Parent = hit.Parent
        local C = g:GetChildren()
        for i=1, #C do
            if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "WedgePart" then
                local W = Instance.new("Weld")
                W.Part0 = g.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g.Middle.Position)
                local C0 = g.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g.Middle
            end
                local Y = Instance.new("Weld")
                Y.Part0 = hit.Parent["Left Arm"]
                Y.Part1 = g.Middle
                Y.C0 = CFrame.new(0, 0, 0)
                Y.Parent = Y.Part0
        end

        local h = g:GetChildren()
        for i = 1, # h do
            if h[i].className == "Part" or  h[i].className == "UnionOperation" or C[i].className == "WedgePart" then
                h[i].Anchored = false
                h[i].CanCollide = false
            end
        end

    end

end

script.Parent.Touched:connect(onTouched)

Basically every Arms, legs, torso script have the same except for Torso it says "Chest" which is the name of the helmet, and "Arm1" is the name of the armor.

3
STRAIGHT OUTTA THE TOOLBOX User#19524 175 — 5y
0
I was told no, all I need is help. D3VRO 66 — 5y
0
A person who can make such a script like this, I believe, would not have the issue you're having, or would at least be able to solve it. Also, we all know this is a FM since it uses deprecated properties/methods, and doesn't even use the generic for loop. Just saying.. Shawnyg 4330 — 5y
View all comments (2 more)
0
Okay, well I was just here to help out the guy, he wasn't the one who "scripted it" so I have no such if it's a FM or not. But if you think so go ahead. D3VRO 66 — 5y
0
free model lol. LoganboyInCO 150 — 5y

Closed as Not Constructive by EzraNehemiah_TF2

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?