Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

0

Don't come on this site and expect us to just fix your broken code like that...

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.