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
 

Weld Help

Previous Thread :: Next Thread 
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 12:02 PM
My Fake Arms (Variables left and right), don't weld correctly onto the character's real arms and just fall on the ground instead of welding inside, the script works, but it's not doing it correctly:

script.Parent.Equipped:connect(function(mouse)
local p = script.Parent
local s = script.Parent.Parent["Left Arm"]
local wa = Instance.new("Weld",script.Parent.Handle)
wb = Instance.new("Weld",script.Parent.Handle)
left = Instance.new("Part",script.Parent.Parent.Parent)
right = Instance.new("Part",script.Parent.Parent.Parent)
local wc = Instance.new("Weld",left)
local wd = Instance.new("Weld",right)
local m = Instance.new("SpecialMesh",left)
local m2 = Instance.new("SpecialMesh",right)
left.CanCollide = false
right.CanCollide = false
m.Scale = Vector3.new(0.98,0.98,0.98)
m2.Scale = Vector3.new(0.98,0.98,0.98)
m.MeshId = "http://www.roblox.com/asset/?id=27111419"
m2.MeshId = "http://www.roblox.com/asset/?id=27111864"
wc.Part0 = left
wd.Part0 = right
wc.Part1 = s
wd.Part1 = script.Parent.Handle
left.Size = Vector3.new(s.Size.X,s.Size.Y,s.Size.Z)
right.Size = Vector3.new(s.Size.X,s.Size.Y,s.Size.Z)
wa.Part0 = script.Parent.Handle
wa.Part1 = script.Parent.Part1
wb.Part0 = script.Parent.Handle
wb.Part1 = script.Parent.Part2
wa.C0 = CFrame.new(0,0.66,0.12)
wb.C0 = CFrame.new(0,0.84,0.26)
wc.C0 = CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)*CFrame.new(0,0,0.5)
wd.C0 = CFrame.new(0,0,0)
end)
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 01:20 PM
Bump
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 01:22 PM
I had the same problem, parent the welds after setting the part0 part1 and stuff
If that doesn't work I don't know sorry.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 01:33 PM
@UnBuild

Thanks, it gave me a different effect that I should be able to debug.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 01:36 PM
Error: maximum depth re-entrancy exceeded

script.Parent.Equipped:connect(function(mouse)
local p = script.Parent
local s = script.Parent.Parent["Left Arm"]
local wa = Instance.new("Weld",script.Parent.Handle)
wb = Instance.new("Weld",script.Parent.Handle)
left = Instance.new("Part",script.Parent.Parent)
right = Instance.new("Part",script.Parent.Parent)
local wc = Instance.new("Weld")
local wd = Instance.new("Weld")
local m = Instance.new("SpecialMesh",left)
local m2 = Instance.new("SpecialMesh",right)
left.CanCollide = false
right.CanCollide = false
m.Scale = Vector3.new(0.98,0.98,0.98)
m2.Scale = Vector3.new(0.98,0.98,0.98)
m.MeshId = "http://www.roblox.com/asset/?id=27111419"
m2.MeshId = "http://www.roblox.com/asset/?id=27111864"
wc.Part0 = s
wd.Part0 = right
wc.Part1 = left
wd.Part1 = script.Parent.Handle
left.Size = Vector3.new(s.Size.X,s.Size.Y,s.Size.Z)
right.Size = Vector3.new(s.Size.X,s.Size.Y,s.Size.Z)
wa.Part0 = script.Parent.Handle
wa.Part1 = script.Parent.Part1
wb.Part0 = script.Parent.Handle
wb.Part1 = script.Parent.Part2
wa.C0 = CFrame.new(0,0.66,0.12)
wb.C0 = CFrame.new(0,0.84,0.26)
wc.C0 = CFrame.new(0,0,0.1)
wd.C0 = CFrame.new(0,0,0)
wc.Parent = left
wd.Parent = right
end)
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 01:36 PM
If you still have errors, make sure you are parenting it after everything in the weld is set, not just Part0 and Part1
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 01:47 PM
Well, actually this error just came up after I did what you told me to. I parented it at the end of the function.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 02:41 PM
Your event is triggering to fast.


Sunday Apr 28 19:38:56 2013 - maximum event re-entrancy depth exceeded
This is caused by too many events triggering each other. A simple example is this script:
local bv = Instance.new("BoolValue")
bv.Parent = script
bv.Value = false

bv.Changed:connect( function() bv.Value = not bv.Value end )

bv.Value = true


No idea what to do, Try adding a wait at the very top (But within the function)
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 02:44 PM
I did some digging

"This might be caused by a rather strange bug. Basically, if you insert an object into the character immediately after equipping (e.g. from the Equipped event), the Equipped event will fire once again. So, you get this re-entrancy depth error because Equipped keeps triggering itself over and over.

I assume you're doing something like inserting a shield into the character when the sword is equipped. Try inserting a wait() right before that. That will prevent the bug from occurring."
-Anaminus
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 03:26 PM
I'm sticking wait() everywhere.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 03:27 PM
K I put the waits in the right spot, now I have to fix ALOT of Welds.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 03:35 PM
No no no

script.Parent.Equipped:connect(function(mouse)
wait(0.03)
--Rest of code



Fixed.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
28 Apr 2013 03:36 PM
I put waits at:

The beginning of the function
Before the welds were parented
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
28 Apr 2013 03:40 PM
Second wait will make the parts fall before they are welded.

The weld doesn't take effect till it is parented.
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