generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Would this weld script work?

Previous Thread :: Next Thread 
skyarex is not online. skyarex
Joined: 21 Mar 2010
Total Posts: 12989
08 Dec 2013 06:04 AM
function Weldnow()
local w1 = Instance.new("Weld")
w1.Parent = script.Parent.Handle -- This is the original Handle.
w1.Part0 = w1.Parent
w1.Part1 = script.Parent.:GetChildren(Wedge) -- Change PARTNAME to your second part's name.
w1.C1 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 0, 0)

local w2 = Instance.new("Weld")
w2.Parent = script.Parent.Handle
w2.Part0 = w1.Parent
w2.Part1 = script.Parent.:GetChildren(BasePlate) -- Change this to the third part's name.
w2.C1 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 0, 0)

local w3 = Instance.new("Weld")
w3.Parent = script.Parent.Handle
w3.Part0 = w1.Parent
w3.Part1 = script.Parent.:GetChildren(RingMeshLarge) -- Change this to the third part's name.
w3.C1 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 0, 0)

local w4 = Instance.new("Weld")
w4.Parent = script.Parent.Handle
w4.Part0 = w1.Parent
w4.Part1 = script.Parent.Muzzle -- Change this to the third part's name.
w4.C1 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 0, 0)

local w5 = Instance.new("Weld")
w5.Parent = script.Parent.Handle
w5.Part0 = w1.Parent
w5.Part1 = script.Parent:GetChildren(BarrelMesh) -- Change this to the third part's name.
w5.C1 = CFrame.Angles(0, 0, 0) * CFrame.new(0, 0, 0)


end
script.Parent.Equipped:connect(Weldnow)
script.Parent.Unequipped:connect(Weldnow)

NOTE:
there are multiple parts named the same. The only exception being the Muzzle part.

"Don't Panic"- HHGTTG
Report Abuse
skyarex is not online. skyarex
Joined: 21 Mar 2010
Total Posts: 12989
08 Dec 2013 06:22 AM
bump

"Don't Panic"- HHGTTG
Report Abuse
skyarex is not online. skyarex
Joined: 21 Mar 2010
Total Posts: 12989
08 Dec 2013 06:33 AM
bump again

"Don't Panic"- HHGTTG
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
08 Dec 2013 06:40 AM
its not going to work
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
08 Dec 2013 06:44 AM
function weld(p1,p2)
w = Instance.new("Weld",p1)
w.Part0 = p1
w.Part1 = p2
w.C1 = CFrame.new(0,0,0)
end

function Weldnow()
for i,v in pairs(script.Parent:GetChildren())do
if v.Name ~= "Handle" then
weld(script.Parent.Handle,v)
end end end

script.Parent.Equipped:connect(Weldnow)
script.Parent.Unequipped:connect(Weldnow)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image