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

Can someone help me convert this script to FE? In game no one but you can see the morph. [closed]

Asked by 6 years ago

player = game.Players.LocalPlayer morph = game.Lighting.Morphs["Virtus Female"] -- ONLY LINE TO CHANGE

function onTouched(hit) local character = player.Character if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm1") == nil then local g = morph.Arm1:clone() g.Parent = character 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 = character["LeftUpperArm"] 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

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm2") == nil then
    local g = morph.Arm2:clone()
    g.Parent = character
    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 = character["LeftLowerArm"]
            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

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Chest") == nil then
    local g = morph.Chest:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" 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 = character.UpperTorso
            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 == "MeshPart" then  
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm3") == nil then
    local g = morph.Arm3:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" 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 = character["RightUpperArm"]
            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" then
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm4") == nil then
    local g = morph.Arm4:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" 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 = character["RightLowerArm"]
            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" then
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Eyes") == nil then
    local g = morph.Eyes:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" 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 = character["Head"]
            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 == "MeshPart" then  
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

local h = character:findFirstChild("Humanoid")
if h~=nil then
    local s = character:findFirstChild("Pants")
    if s~=nil and d~=nil then
        character.Pants:remove()
        morph.Pants:clone().Parent = character
    elseif s~=nil then
        character.Pants:remove()
        morph.Pants:clone().Parent = character
    elseif d~=nil then
        morph.Pants:clone().Parent = character
    elseif s==nil and d==nil then
        morph.Pants:clone().Parent = character
    end
end

local h = character:findFirstChild("Humanoid")
if h~=nil then
    local s = character:findFirstChild("Shirt")
    if s~=nil and d~=nil then
        character.Shirt:remove()
        morph.Shirt:clone().Parent = character
    elseif s~=nil then
        character.Shirt:remove()
        morph.Shirt:clone().Parent = character
    elseif d~=nil then
        morph.Shirt:clone().Parent = character
    elseif s==nil and d==nil then
        morph.Shirt:clone().Parent = character
    end
end

end

script.Parent.MouseButton1Click:connect(onTouched)

Closed as Not Constructive by User#24403, yHasteeD, and User#23365

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?

1 answer

Log in to vote
-1
Answered by 6 years ago

player = game.Players.LocalPlayer morph = game.Lighting.Morphs["Virtus Female"] -- ONLY LINE TO CHANGE

function onTouched(hit) local character = player.Character if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm1") == nil then local g = morph.Arm1:clone() g.Parent = character 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 = character["LeftUpperArm"] 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

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm2") == nil then
    local g = morph.Arm2:clone()
    g.Parent = character
    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 = character["LeftLowerArm"]
            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

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Chest") == nil then
    local g = morph.Chest:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" 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 = character.UpperTorso
            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 == "MeshPart" then  
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm3") == nil then
    local g = morph.Arm3:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" 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 = character["RightUpperArm"]
            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" then
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Arm4") == nil then
    local g = morph.Arm4:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" 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 = character["RightLowerArm"]
            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" then
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

if character:findFirstChild("Humanoid") ~= nil and character:findFirstChild("Eyes") == nil then
    local g = morph.Eyes:clone()
    g.Parent = character
    local C = g:GetChildren()
    for i=1, #C do
        if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" 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 = character["Head"]
            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 == "MeshPart" then  
            h[i].Anchored = false
            h[i].CanCollide = false
        end
    end

end

local h = character:findFirstChild("Humanoid")
if h~=nil then
    local s = character:findFirstChild("Pants")
    if s~=nil and d~=nil then
        character.Pants:remove()
        morph.Pants:clone().Parent = character
    elseif s~=nil then
        character.Pants:remove()
        morph.Pants:clone().Parent = character
    elseif d~=nil then
        morph.Pants:clone().Parent = character
    elseif s==nil and d==nil then
        morph.Pants:clone().Parent = character
    end
end

local h = character:findFirstChild("Humanoid")
if h~=nil then
    local s = character:findFirstChild("Shirt")
    if s~=nil and d~=nil then
        character.Shirt:remove()
        morph.Shirt:clone().Parent = character
    elseif s~=nil then
        character.Shirt:remove()
        morph.Shirt:clone().Parent = character
    elseif d~=nil then
        morph.Shirt:clone().Parent = character
    elseif s==nil and d==nil then
        morph.Shirt:clone().Parent = character
    end
end

end

script.Parent.MouseButton1Click:connect(onTouched)

Ad