Cloning and welding a morph from ServerStorage to the Torso?
01 | script.Parent.MouseButton 1 Down:connect( function () |
02 | local Player = script.Parent.Parent.Parent.Parent.Parent |
03 | if Player.Character:FindFirstChild( "Humanoid" ) ~ = nil and Player.Character:FindFirstChild( "BTorso" ) ~ = nil then |
04 | local suit = game.ServerStorage.Morphs.Police.Standard [ "BTorso" ] :Clone() |
05 | suit.Parent = Player.Character |
06 | local G = suit:GetChildren() |
08 | if G [ i ] .ClassName = = "Part" or "UnionOperation" then |
09 | local suitW = Instance.new( "Weld" ) |
10 | suitW.Part 0 = suit.MainPart |
12 | local autoW = CFrame.new(suit.MainPart.Position) |
13 | suitW.C 0 = suit.MainPart.CFrame:inverse()*autoW |
14 | suitW.C 1 = G [ i ] .CFrame:inverse()*autoW |
15 | suitW.Parent = suit.MainPart |
17 | local bpW = Instance.new( "Weld" ) |
18 | bpW.Part 0 = Player.Character [ "Torso" ] |
19 | bpW.Part 1 = suit.MainPart |
20 | bpW.C 0 = CFrame.new( 0 , 0 , 0 ) |
21 | bpW.Parent = suit.MainPart |
23 | local f = suit:GetChildren() |
26 | f [ i ] .CanCollide = false |
I ended up making this script so that I could use a GUI to clone and weld parts onto the players' torso. I'm not sure why it's not working? There's nothing in output, and nothing happens when I click the button. Any help?