Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone fix my Anti-Gravity Script? I need it fixed ASAP!! [closed]

Asked by 6 years ago

I need some to fix this script:

workspace = game.Workspace:getChildren()

antigrav = 0 --edit this for force of antigravity
gravforce = 195.5729088953 * antigrav


function check(object)
    for i = 1, #object do
    wait()
    add(object[i])
    end
end

function add(object)
    if object.className == ("Model") or object.className == ("Tool") or object.className == ("Accoutrement") then
    check(object:getChildren())
    end
    if object.className == ("Part") or object.className == ("Truss") then
        if object.Anchored == false then
        local bforce = Instance.new("BodyForce")
        bforce.force = Vector3.new(0, ((object:getMass())*gravforce), 0)
        bforce.Parent = object
        end
    end
end
check(workspace)

game.Workspace.ChildAdded:connect(function(object) add(object) end)

0
Don't come on this site and expect us to just fix your broken code like that... User#19524 175 — 6y

Closed as Not Constructive by User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
-1
Answered by 6 years ago

You can edit the world's gravity via Workspace's properties.

Ad