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

How to make player no gravity?

Asked by 6 years ago

How to make player no gravity.

Like when you catch the Balloon on Super Mario World.

I maked script like this.

local part = script.Parent
local head = 0.1

part.Touched:connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        script.Disabled = true
        script.Sound:Play()
        player.Character.Humanoid.HeadScale.Value = 1.1
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.2
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.3
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.4
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.5
        player.Character.Humanoid.Gravity = -2
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.6
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.7
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.8
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.9
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 2
        wait(15)
        player.Character.Humanoid.HeadScale.Value = 1.9
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.8
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.7
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.6
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.5
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.4
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.3
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.2
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1.1
        wait(head)
        player.Character.Humanoid.HeadScale.Value = 1
        player.Cahracter.Humanoid.Gravity = 0
        script.Disabled = false
    end
end)

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

I just went into a test world and found a way to do what I think you want to do:

script.Parent.Touched:Connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then local parent = player.Character.HumanoidRootPart local bodyForce = Instance.new("BodyForce") bodyForce.Force = Vector3.new(0, parent:GetMass() * workspace.Gravity, 0) bodyForce.Parent = parent end end)

Ad

Answer this question