2AreYouMental110

zero gravity script (unanchored parts only)

Oct 20th, 2021
1,070
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- original https://www.youtube.com/watch?v=dxVuEE3WErI
  2.  
  3. -- when you execute, whatever thing you unanchored goes 0 grav
  4.  
  5. speed = 10
  6. spawn(function()
  7. while true do
  8. game.Players.LocalPlayer.MaximumSimulationRadius = math.pow(math.huge,math.huge)*math.huge
  9. game.Players.LocalPlayer.SimulationRadius = math.pow(math.huge,math.huge)*math.huge
  10. game:GetService("RunService").Stepped:wait()
  11. end
  12. end)
  13. while wait(speed) do
  14. local function zeroGrav(part)
  15.    if part:FindFirstChild("BodyForce") then return end
  16.    local temp = Instance.new("BodyForce")
  17.    temp.Force = part:GetMass() * Vector3.new(0,workspace.Gravity,0)
  18.    temp.Parent = part
  19. end
  20.  
  21. for i,v in ipairs(workspace:GetDescendants()) do
  22.    if v:IsA("Part") and v.Anchored == false then
  23.        if not (v:IsDescendantOf(game.Players.LocalPlayer.Character)) then
  24.            zeroGrav(v)
  25.        end
  26.    end
  27. end
  28.  
  29. workspace.DescendantAdded:Connect(function(part)
  30.    if part:IsA("Part") and v.Anchored == false then
  31.        if not (part:IsDescendantOf(game.Players.LocalPlayer.Character)) then
  32.            zeroGrav(part)
  33.        end
  34.    end
  35. end)
  36. end
  37. print()
RAW Paste Data