Advertisement
foxywolf233

FE Soccer Ball

Jan 10th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1.  
  2.  
  3. --[[
  4.  
  5. script made by MyWorld#4430
  6.  
  7. join for more cool scripts:
  8. discord.gg/pYVHtSJmEY
  9.  
  10. recommended hats:
  11. roblox.com/catalog/62234425
  12. roblox.com/catalog/63690008
  13. roblox.com/catalog/62724852
  14. roblox.com/catalog/451220849
  15. roblox.com/catalog/48474294
  16. roblox.com/catalog/48474313
  17.  
  18. note: works with any 6 hats
  19.  
  20. ]]
  21.  
  22. local netboost = Vector3.new(0, 45, 0)
  23.  
  24. local ws = game:GetService("Workspace")
  25. local rs = game:GetService("RunService")
  26. local lp = game:GetService("Players").LocalPlayer
  27.  
  28. local function align(Part0, Part1)
  29. Part0.CustomPhysicalProperties = PhysicalProperties.new(0.0001, 0.0001, 0.0001, 0.0001, 0.0001)
  30.  
  31. local att1 = Instance.new("Attachment")
  32. att1.Orientation = Vector3.new(0, 0, 0)
  33. att1.Position = Vector3.new(0, 0, 0)
  34. att1.Archivable = true
  35. local att0 = att1:Clone()
  36.  
  37. local ap = Instance.new("AlignPosition", att0)
  38. ap.ApplyAtCenterOfMass = false
  39. ap.MaxForce = math.huge
  40. ap.MaxVelocity = math.huge
  41. ap.ReactionForceEnabled = false
  42. ap.Responsiveness = 200
  43. ap.RigidityEnabled = false
  44.  
  45. local ao = Instance.new("AlignOrientation", att0)
  46. ao.MaxAngularVelocity = math.huge
  47. ao.MaxTorque = math.huge
  48. ao.PrimaryAxisOnly = false
  49. ao.ReactionTorqueEnabled = false
  50. ao.Responsiveness = 200
  51. ao.RigidityEnabled = false
  52.  
  53. ap.Attachment1 = att1
  54. ap.Attachment0 = att0
  55. ao.Attachment1 = att1
  56. ao.Attachment0 = att0
  57.  
  58. att1.Parent = Part1
  59. att0.Parent = Part0
  60.  
  61.  
  62. if netboost then
  63. spawn(function()
  64. while rs.Heartbeat:Wait() and Part0 and Part0.Parent do
  65. Part0.Velocity = netboost
  66. end
  67. end)
  68. spawn(function()
  69. while rs.Stepped:Wait() and Part0 and Part0.Parent and Part1 and Part1.Parent do
  70. Part0.Velocity = Part1.Velocity
  71. end
  72. end)
  73. end
  74. end
  75. local c = lp.Character
  76. local function gp(parent, name, className)
  77. local ret = nil
  78. if parent then
  79. for i, v in pairs(parent:GetChildren()) do
  80. if (v.Name == name) and v:IsA(className) then
  81. ret = v
  82. end
  83. end
  84. end
  85. return ret
  86. end
  87. local startpart = gp(c, "Torso", "BasePart") or gp(c, "HumanoidRootPart", "BasePart") or gp(c, "Head", "BasePart")
  88. if not startpart then
  89. print("part not found")
  90. return
  91. end
  92. local size = Vector3.new(1, 1, 2)
  93. local orient = {
  94. Vector3.new(45 ,-45, 0),
  95. Vector3.new(45, -135, 0),
  96. Vector3.new(0, 90, 0),
  97. Vector3.new(45, 45, 0),
  98. Vector3.new(45, 135, 0),
  99. Vector3.new(0, 0, 0)
  100. }
  101. local hats = {}
  102. for i, v in pairs(c:GetChildren()) do
  103. if v:IsA("Accessory") then
  104. table.insert(hats, v)
  105. end
  106. end
  107. local allhandles = {}
  108. for i, v in pairs(hats) do
  109. local handle = gp(v, "Handle", "BasePart")
  110. if handle then
  111. table.insert(allhandles, handle)
  112. end
  113. end
  114. local handles = {}
  115. for i, v in pairs(allhandles) do
  116. if v.Size == size then
  117. table.insert(handles, v)
  118. end
  119. end
  120. if #handles < #orient then
  121. for i, v in pairs(allhandles) do
  122. if not table.find(handles, v) then
  123. table.insert(handles, v)
  124. end
  125. if #handles == #orient then
  126. break
  127. end
  128. end
  129. end
  130. if #handles < #orient then
  131. print("not enough hats")
  132. return
  133. end
  134. local ball = Instance.new("Part", ws)
  135. ball.Anchored = true
  136. ball.CanCollide = false
  137. ball.CanTouch = false
  138. ball.Transparency = 1
  139. ball.Shape = "Ball"
  140. ball.Size = Vector3.new(2.3, 2.3, 2.3)
  141. ball.Position = startpart.Position
  142. for i, v in pairs(orient) do
  143. local handle = handles[i]
  144. handle:ClearAllChildren()
  145. local part = Instance.new("Part", ball)
  146. part.Massless = true
  147. part.Transparency = 1
  148. part.Anchored = true
  149. part.CanCollide = false
  150. part.Position = ball.Position
  151. part.Orientation = v
  152. local weld = Instance.new("WeldConstraint", part)
  153. weld.Part0 = ball
  154. weld.Part1 = part
  155. weld.Enabled = true
  156. handle.Parent = part
  157. align(handle, part)
  158. part.Anchored = false
  159. handle.Changed:Connect(function(prop)
  160. if (prop == "Parent") and part and part.Parent then
  161. part:Destroy()
  162. end
  163. end)
  164. end
  165. ball.CanCollide = true
  166. ball.Anchored = false
  167. c.Changed:Connect(function(prop)
  168. if (prop == "Parent") and ball and ball.Parent then
  169. ball:Destroy()
  170. end
  171. end)
  172.  
  173.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement