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

How can I make a brick that when touched, turns off a player's gravity?

I basically want to make it like once a player touches a brick, they float around like they're in space with 0 gravity. How do I do this?

1 comment

0

Calculate the player's weight using the formula "Weight = mass * gravity", inverse the direction, then apply the force on the player using a BodyThrust

1 answer

✓ Accepted answer

im not really the best scripter but heres what i got

cantouch = true
-- notes: not no grav cuz yeah but its close, put script in part
-- made by karbis (pls dont remove k ty)
function touched(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if cantouch then
			cantouch = false
			local bodyforce = Instance.new("BodyForce", hit.Parent.HumanoidRootPart)
			bodyforce.Force = Vector3.new(0,2000,0)
			wait(1)
			cantouch = true
		end
	end
end

script.Parent.Touched:Connect(touched)

1 comment

0

Thank you so much, it worked perfectly.

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