Im trying to make a script where when the parts velocity is 15.904 or above, that the player who got hit by the part sits, and i noticed when the velocity is under that number after it was above… the player still sits when touched, i don’t know how to fix this, can anyone help me?
here is my script:
local trippart = script.Parent
local car1 = script.Parent
function checkVelocity()
while true do
wait(0.1)
local velocity = car1.Velocity.Magnitude
if velocity >= 15.904 then
trippart.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid")then
part.Parent.Humanoid.Sit = true
end
end)
end
end
end
while true do
checkVelocity()
end