Make a player fall more slowly

so i have this script which makes the player casually sit. simple. the problem is that this is used for one of those fall in balls thing. just basically falling with alot of objects you bumb into. the thing is this happens really fast and you fall mega fast so the fun is over fast, i was wondering if it was possible to make it that as long as your sitting maybe your gravity or falling speed is slower? i dont know.

print("Sit script working")

brick = script.Parent

function OnTouched(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid") 
	if (humanoid ~= nil) then	
	humanoid.Sit = true
	end
end

script.Parent.Touched:connect(OnTouched)	
2 Likes

You could probably use BodyForce to negate gravity.

Try creating a new BodyForce, putting it in the character’s root part, and setting it to something like…

local force = rootpart:GetMass()*190
bodyforce.Force = Vector3.new(force, force, force)

If the results don’t look great, you could either increase the multiplier (for less gravity impact) or decrease it for more gravity impact.

Hope this helps

6 Likes

1: does this only implie when using this script because its only one part of the game and i dont want the rest to be weirdly gravitated. 2: can you insert it into the script?

1 Like

You only need to apply force on the Y axis. You don’t need to do it on the other axes. You may also need to account for the masses of their other body parts and accessories, since they have mass too (i.e. Massless property is false).

This can be used:

local character = humanoid.Parent
local totalMass = 0

for _, part in pairs(character:GetDescendants()) do
    if part:IsA("BasePart") and (not part.Massless) then
        totalMass = totalMass + part:GetMass()
    end
end

local a = 150 --[[ acceleration upwards
Roblox's gravitational acceleration is 196.2 by default, if you haven't changed it
You want a to be less than the gravitational acceleration for the player to still be falling
--]]
local force = totalMass * a
bodyForce.Force = Vector3.new(0, force, 0)

Also, considering that all matter (even atoms) has their own gravitational pull, you could assume that each part of the player has their own gravitational pull and they have different forces due to the difference in their mass and those add up to get the total weight (gravitational pull). This is why you have to account for the masses of all the other parts of their character

5 Likes

where do i put this script, so this also doesnt mess with any other gravity in the game right?

This would go along with the block of the if statement, so you will just put the code in the if statement:

function OnTouched(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid") 
	if (humanoid ~= nil) then	
	    humanoid.Sit = true
        local character = humanoid.Parent
        local totalMass = 0

        for _, part in pairs(character:GetDescendants()) do
            if part:IsA("BasePart") and (not part.Massless) then
                totalMass = totalMass + part:GetMass()
            end
        end

        local a = 150 --[[ acceleration upwards
        Roblox's gravitational acceleration is 196.2 by default, if you haven't changed it
        You want a to be less than the gravitational acceleration for the player to still be 
        falling
        --]]
        local force = totalMass * a
        bodyForce.Force = Vector3.new(0, force, 0)
	end
end

script.Parent.Touched:connect(OnTouched)	

And no, this won’t affect other players’ or the game’s gravitational pull. After the player lands, you can remove the BodyForce

i havent noticed any difference even when changing the number multiple times?

Forgot to instantiate the BodyForce and set its parent:

local bodyForce = Instance.new("BodyForce")
local force = totalMass * a
bodyForce.Force = Vector3.new(0, force, 0)
bodyForce.Parent = character.HumanoidRootPart

Btw, I implore you to check the output before asking again here – you would’ve seen an error in the output because the bodyForce wasn’t created yet

i put this at top? (30 characters)

i added this to the top and it wouldnt sit me anymore, i added it to the bottom and i sat but with no gravitational changes

@Rare_tendo ? (30 characters))))

You can change the gravity of the workspace, but thaat will also affect the speed and jump.

hmmm, is it possible to make it if you touch that and fall, your gravity is less and when you press spacebar to stand up again gravity becomes normal?

1 Like

You can make that on touch the gravity will change.

workspace.Gravity = 100 --Just an example how to change it

Here’s an example with your script:

brick = script.Parent

function OnTouched(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid") 
	if (humanoid ~= nil) then	
	humanoid.Sit = true
        workspace.Gravity = 100 --Change it to the number that suits you.
	end
end

script.Parent.Touched:connect(OnTouched)	

but then i was thinking another part to revert the gravity back to normal but then people would get up and stand in the middle of the fall and then use the less gravity to cheat things

1 Like

Oh, so you’re worried that normal people will touch it and it will revert?
Maybe in the same script create a table of the players who touched, and then check if they touch it.
Do you have multiple parts that need to fall slow or only the player?

only people (30 charcaters)))))

Oh, then that’s not a problem, just make a local script that checks if the part is touched, in a place that it works, and check if the local player is the player that touched. If it is , change/revert the gravity, that way only 1 player’s gravity will change, and if one player touches the part it won’t affect other players.

function OnTouched(part)
	local humanoid = part.Parent:FindFirstChild("Humanoid") 
	if (humanoid ~= nil) then	
	    humanoid.Sit = true
        local character = humanoid.Parent
        local totalMass = 0

        for _, part in pairs(character:GetDescendants()) do
            if part:IsA("BasePart") and (not part.Massless) then
                totalMass = totalMass + part:GetMass()
            end
        end

        local a = 150 --[[ acceleration upwards
        Roblox's gravitational acceleration is 196.2 by default, if you haven't changed it
        You want a to be less than the gravitational acceleration for the player to still be 
        falling
        --]]
        local bodyForce = Instance.new("BodyForce")
        local force = totalMass * a
        bodyForce.Force = Vector3.new(0, force, 0)
        bodyForce.Parent = character.HumanoidRootPart
	end
end

script.Parent.Touched:connect(OnTouched)