Advertisement
Guest User

Wield script

a guest
Feb 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Ugh, every time, i think about it and it won't work! I cannot see the problem properly, please help me fix it, a wield script
  2. function Weld(x,y)
  3.  
  4. local W = Instance.new("Weld")
  5. W.Part0 = x
  6. W.Part1 = y
  7. local CJ = CFrame.new(x.Position)
  8. local C0 = y.CFrame:inverse()*CJ
  9. local C1 = z.CFrame:inverse()*CJ
  10. W.C0 = C0
  11. W.C1 = C1
  12. W.Parent = x
  13. end
  14.  
  15. function Get(A)
  16. if A.className == "Part" then
  17. Weld(script.Parent.Handle, A)
  18. A.Anchored = false
  19. else
  20. local C = A:GetChildren()
  21. for i=1, #C do
  22. Get(C[i])
  23. end
  24. end
  25. end
  26.  
  27. function Finale()
  28. Get(script.parent)
  29. end
  30.  
  31. script.Parent.Equiped:connect(Finale)
  32. script.Parent.Unequiped:connect(Finale)
  33. Finale()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement