Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- || 📜 AUTHOR: @4zx16 || Morph Remade V2
- ]]
- local function Create_Morph(hit)
- --[[
- ---------------------------------------------------------------------
- FINDFIRSTCHILD / VARIABLES:
- ----------------------------------------------------------------------
- --]]
- local Humanoid = hit.Parent:FindFirstChild("Humanoid")
- local Arm1 = hit.Parent:FindFirstChild("Arm1")
- local Arm2 = hit.Parent:FindFirstChild("Arm2")
- local Leg1 = hit.Parent:FindFirstChild("Leg1")
- local Leg2 = hit.Parent:FindFirstChild("Leg2")
- local Torso = hit.Parent:FindFirstChild("Chest")
- local Head = hit.Parent:FindFirstChild("xHead")
- --[[
- ---------------------------------------------------------------------
- USER BODY PARTS:
- ----------------------------------------------------------------------
- --]]
- local PLR_Head = hit.Parent:FindFirstChild("Head")
- local PLR_Torso = hit.Parent:FindFirstChild("Torso")
- local PLR_Left_Arm = hit.Parent:FindFirstChild("Left Arm")
- local PLR_Right_Arm = hit.Parent:FindFirstChild("Right Arm")
- local PLR_Left_Leg = hit.Parent:FindFirstChild("Left Leg")
- local PLR_Right_Leg = hit.Parent:FindFirstChild("Right Leg")
- local PLR_Right_Arm = hit.Parent:FindFirstChild("Right Arm")
- local User = hit.Parent:GetChildren()
- --[[
- ---------------------------------------------------------------------
- ACTUAL FUNCTIONS:
- ----------------------------------------------------------------------
- --]]
- if Humanoid ~= nil and Arm1 == nil then
- local g = script.Parent.Parent.Arm1:Clone()
- local C = g:GetChildren()
- g.Parent = hit.Parent
- 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 = 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 C[i].className == "UnionOperation" then
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- end
- if Humanoid ~= nil and Arm2 == nil then
- local g = script.Parent.Parent.Arm2:Clone()
- local C = g:GetChildren()
- g.Parent = hit.Parent
- 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 = hit.Parent["Right 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 C[i].className == "UnionOperation" then
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- end
- if Humanoid ~= nil and Leg1 == nil then
- local g = script.Parent.Parent.Leg1:Clone()
- local C = g:GetChildren()
- g.Parent = hit.Parent
- 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 = hit.Parent["Left Leg"]
- 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 C[i].className == "UnionOperation" then
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- end
- if Humanoid ~= nil and Leg2 == nil then
- local g = script.Parent.Parent.Leg2:Clone()
- local C = g:GetChildren()
- g.Parent = hit.Parent
- 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 = hit.Parent["Right Leg"]
- 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 C[i].className == "UnionOperation" then
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- end
- if Humanoid ~= nil and Head == nil then
- local g = script.Parent.Parent.xHead:Clone()
- local C = g:GetChildren()
- g.Parent = hit.Parent
- 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 = hit.Parent["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 C[i].className == "UnionOperation" then
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- end
- if Humanoid ~= nil and Torso == nil then
- local g = script.Parent.Parent.Chest:Clone()
- local C = g:GetChildren()
- g.Parent = hit.Parent
- 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 = hit.Parent.Torso
- 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 C[i].className == "UnionOperation" then
- h[i].Anchored = false
- h[i].CanCollide = false
- end
- end
- if Humanoid ~= nil then
- if hit.Parent:FindFirstChild("Head"):FindFirstChild("face").Texture == nil then return end
- hit.Parent:FindFirstChild("Head"):FindFirstChild("face").Texture = 0
- end
- end
- for i = 1, #User do
- if User[i].className == "Accessory" then
- User[i]:remove()
- end
- PLR_Head.Transparency = 0.98
- PLR_Torso.Transparency = 1
- PLR_Left_Arm.Transparency = 1
- PLR_Right_Arm.Transparency = 1
- PLR_Left_Leg.CanCollide = true
- PLR_Left_Leg.Transparency = 1
- PLR_Right_Leg.CanCollide = true
- PLR_Right_Leg.Transparency = 1
- end
- end
- script.Parent.Touched:Connect(Create_Morph)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement