This line of code is responsible for applying gravity to the player. there is probably a better way to achieve this so please provide feedback
function Controll:GroundedOrNot()
local function notInAir()
if not self.inAir then
player.LocalPlayer.Character.PlayerCapsul.bodyVelocity.Velocity = Vector3.new(0, 0, 0)
run:UnbindFromRenderStep("NotAir")
end
end
local function notGrounded()
if self.inAir then
player.LocalPlayer.Character.PlayerCapsul.bodyVelocity.Velocity -= Vector3.new(0, 2, 0)
run:BindToRenderStep("NotAir", Enum.RenderPriority.Character.Value, notInAir)
end
end
run:BindToRenderStep("Grounded", Enum.RenderPriority.Character.Value, notGrounded)
end