Arm weld works fine in studio, but breaks on server?
Hi there, scripters!
I'm having a problem with a weld (that is created through Instance) in my game. When you equip a tool, a weld is created, where Part0 is the player's torso and Part1 is the player's left arm. Once the tool is unequipped, this weld is deleted, and the player's left arm naturally positions itself to its former position. When tested on a server, the weld accordingly works, but the player's left arm falls into the ground. Any help is appreciated, thanks!
In case you need the script, here it is (it's server-sided):
01 | function script.Parent.WeldArm.OnServerInvoke(player,equipped,position,angles) |
02 | if equipped = = true then |
03 | local weld = Instance.new( "Weld" ) |
04 | weld.Part 0 = player.Character.Torso |
05 | weld.Parent = player.Character.Torso |
06 | weld.Part 1 = player.Character:FindFirstChild( "Left Arm" ) |
07 | weld.C 1 = position * angles |
09 | if equipped = = false then |
10 | player.Character.Torso:FindFirstChild( "Weld" ):Destroy() |