#How do i make it so you need to wait before getting up?

1 messages · Page 1 of 1 (latest)

split birch
#

Right now i have it like this but the last thing where i give the humanoid the ability back to jump again wont actually succeed and i will keep not being able to jump

#

local bike = script.Parent.Bike.Value

local localPlayer = game.Players.LocalPlayer
local character = localPlayer.Character

function flipped()
while wait() do
if bike.DriveSeat.CFrame.upVector.Y < 0.3 then
character.Humanoid.Jump = true
task.wait(0.1)
character.Humanoid.Sit = true
task.wait(0.1)
character.Humanoid.JumpHeight = 0
task.wait(3)
character.Humanoid.JumpHeight = 7.2
end
end
end

bike.DriveSeat.ChildAdded:Connect(flipped())

odd basin
#

pass the function without the parentheses

split birch
#

yeah

#

It needs to force a sit

#

Basically this scripts works like

#

when you fall off your bike

#

you get into sit

#

so you slide a little

#

and i want it so that after like 4 seconds you can get up

#

im a very new scripter maybe you can tll

odd basin
#

listen to the seat not the bikes cframe

#

and fix the infinite loop i pointed out earlier

split birch
#

yeah i gotta figure out how to do that holdon

split birch
#

the cframe is supposed to tell when your wheelie is too far tilted

#

so when youre too far tilted back you fall off

#

and then you get into the sit animation so you cant move

odd basin
# split birch Wait i dont get that?>

instead of checking the bikes cframe over and over to guess when something went wrong, listen to the actual seat to tell you when the players gets on and off

#

if bike.DriveSeat.CFrame.UpVector.Y < 0.3 then

#

youre constantly polling and guessing the bike flipped

split birch
#

yeah

#

youre saying only poll it while someone is driving it?

odd basin
#

GetPropertyChangedSignal("Occupant")

#

i might be wrong about that

#

i havent touched a seat in the past 5 years

split birch
#

oh