I made a morph with multiple parts that when touched the player becomes it. Now I'm trying to make an onclick version with a GUI local script. I have tried to rearrange the script multiple times but the morph still doesn't appear when I touch the GUI. Can anyone spot any mistakes I have made in my script?
(Steven2mid is the middle of the morph and Steven2 I the chest containing the parts) output: 16:40:07.371 - Steven2 is not a valid member of Frame 16:40:07.373 - Stack Begin 16:40:07.374 - Script 'Players.EarlGrey2014.PlayerGui.stevengui.stevenframe.TextButton.LocalScript', Line 3 16:40:07.375 - Stack End
Local script:
function onClick() if game.Players.LocalPlayer.Character:findFirstChild("Steven2") == nil then local g = script.Parent.Parent.Steven2:clone() g.Parent = game.Players.LocalPlayer.Character local C = g:GetChildren() for i=1, #C do if C[i].className == "Part" or "Union" then local W = Instance.new("Weld") W.Part0 = g.Steven2mid W.Part1 = C[i] local CJ = CFrame.new(g.Steven2mid.Position) local C0 = g.Steven2mid.CFrame:inverse()*CJ local C1 = C[i].CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Steven2mid end local Y = Instance.new("Weld") Y.Part0 = game.Players.LocalPlayer.Character.Torso Y.Part1 = g.Steven2mid 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 "Union" then h[i].Anchored = false h[i].CanCollide = false end end end end script.Parent.MouseButton1Click:connect(onClick)