Advertisement
IGhostxGamerI

Float All Players

May 5th, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. function floatPlayer(player)
  2. if player and player.Parent then
  3. local character = player.Character
  4. if character and character.Parent then
  5. local humanoidRootPart = character:FindFirstChild('HumanoidRootPart')
  6. if humanoidRootPart then
  7. local floatForce = humanoidRootPart:FindFirstChild('FloatForce')
  8. if not floatForce then
  9. floatForce = Instance.new('BodyForce')
  10. floatForce.Name = 'FloatForce'
  11. floatForce.Parent = humanoidRootPart
  12. end
  13. local mass = 0
  14. for _,part in pairs(character:GetDescendants()) do
  15. if part and part:IsA('BasePart') then
  16. mass = mass + part:GetMass()
  17. end
  18. end
  19. floatForce.Force = Vector3.new(0,mass*.8*workspace.Gravity,0)
  20. end
  21. end
  22. end
  23. end
  24. wait(2)
  25. for _,player in pairs(game.Players:GetPlayers()) do
  26. floatPlayer(player)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement