You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? instead of the whole game being in zero gravity i want only a room to be in zero gravity so that when you enter you have zero gravity and when you leave you have normal gravity
-
What is the issue? i dont know how to continue
-
What solutions have you tried so far? been searching on google and other sites but did not find anything
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
antigrav = 1
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)