I was wondering why this repeat loop does not work. Does the script repeat what's between repeat and until, and then move on to the rest of the script once the until statement is true?
player.Humanoid.Seated:Connect(function() if player.Humanoid.SeatPart.Name == "GalleonSeat" then repeat print("Player is seated") wait(0.1) until player.Humanoid.Seated == false print("Player is not sitting anymore") end end)
Seated
is an event of Humanoid
. You're checking if an event equals true. The Seated
event has two parameters, first one a boolean that is true if they're sitting, the second one is the seat they're sitting in. This can be a seat or vehicle seat.player.Character.Humanoid.Seated:Connect(function(active, seatPart) if seatPart.Name == "GalleonSeat" then repeat print("Player is seated") wait(.1) until not player.Character.Humanoid.Sit -- Sit is the property you're looking for. end end)