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

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

Asked by 5 years ago

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?

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 Rare_tendo 3000 — 5y

1 answer

Log in to vote
0
Answered by
karbis 50
5 years ago

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)
0
Thank you so much, it worked perfectly. l3ig_Boss 4 — 5y
Ad

Answer this question