Advertisement
Ryan_Lubia

Fe equip hats

Aug 14th, 2021
1,725
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 1 0
  1. local lp = game.Players.LocalPlayer
  2. local char = lp.Character
  3.  
  4. for i, v in pairs(char:GetChildren()) do
  5. if v:IsA("BallSocketConstraint") then
  6. v:Destroy()
  7. end
  8. end
  9.  
  10. for i, v in pairs(char:GetChildren()) do
  11. if v:IsA("HingeConstraint") then
  12. v:Destroy()
  13. end
  14. end
  15.  
  16. for i, v in pairs(char.Humanoid:GetAccessories()) do
  17. local hat = v.Name
  18.  
  19. char[hat].Archivable = true
  20. local fake = char[hat]:Clone()
  21. fake.Parent = char
  22. fake.Handle.Transparency = 1
  23.  
  24. local hold = false
  25. local enabled = false
  26.  
  27. char[hat].Handle.AccessoryWeld:Destroy()
  28.  
  29. local tool = Instance.new("Tool", lp.Backpack)
  30. tool.RequiresHandle = true
  31. tool.CanBeDropped = false
  32. tool.Name = hat
  33.  
  34. local handle = Instance.new("Part", tool)
  35. handle.Name = "Handle"
  36. handle.Size = Vector3.new(1, 1, 1)
  37. handle.Massless = true
  38. handle.Transparency = 1
  39.  
  40. local positions = {
  41. forward = tool.GripForward,
  42. pos = tool.GripPos,
  43. right = tool.GripRight,
  44. up = tool.GripUp
  45. }
  46.  
  47. tool.Equipped:connect(function()
  48. hold = true
  49. end)
  50.  
  51. tool.Unequipped:connect(function()
  52. hold = false
  53. end)
  54.  
  55. tool.Activated:connect(function()
  56. if enabled == false then
  57. enabled = true
  58. tool.GripForward = Vector3.new(-0.976,0,-0.217)
  59. tool.GripPos = Vector3.new(.95,-0.76,1.4)
  60. tool.GripRight = Vector3.new(0.217,0, 0.976)
  61. tool.GripUp = Vector3.new(0,1,0)
  62. wait(.8)
  63. tool.GripForward = positions.forward
  64. tool.GripPos = positions.pos
  65. tool.GripRight = positions.right
  66. tool.GripUp = positions.up
  67. enabled = false
  68. end
  69. end)
  70.  
  71. game:GetService("RunService").Heartbeat:connect(function()
  72. pcall(function()
  73. char[hat].Handle.Velocity = Vector3.new(30, 0, 0)
  74. if hold == false then
  75. char[hat].Handle.CFrame = fake.Handle.CFrame
  76. elseif hold == true then
  77. char[hat].Handle.CFrame = handle.CFrame
  78. end
  79. end)
  80. end)
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement