[Help Needed] - Force a player to jump when they sit in a seat

Hello everyone. I have been trying many different things to make a player jump when they sit in a seat.
My script is below, there are no errors, and the console from this script prints my username in all caps (good) and that it didn’t find me in the table (good), the issue is it just doesn’t jump me when I sit in a specific seat.

local PendingFlights = {}

local Seat = workspace.Airport.Plane.Pilot
Seat:GetPropertyChangedSignal('Occupant'):Connect(function()
    local Humanoid = Seat.Occupant
    if not Humanoid then return end

    local Character = Humanoid.Parent
    if not Character then return end

    local Player = game.Players:GetPlayerFromCharacter(Character)
    if not Player then return end

    local UpperOccupant = string.upper(Player.Name)
    print(UpperOccupant)
    
    task.wait()
    Humanoid.Jump = true

    for index, flight in pairs(PendingFlights) do
        if flight == UpperOccupant then
            print('found the player in the pending flights table')
            if index == 1 then
                print('their index is one')
            else
                Humanoid.Jump = true
            end
        else
            Humanoid.Jump = true
            print('didnt find the player in the pending flights table')
        end
    end
end)

Regards,
UsedSpxse, Popsiz Chairman
Any help is appreciated. :smiley:

1 Like

Try sethumanoidstate and player.humanoid.jump = true

1 Like

I’ve tried that, but unfortunately, it didn’t work. Anything else?

1 Like

If you want the player to be not sat at all anywhere, try this.

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        local Humanoid = Character:WaitForChild("Humanoid")
        Humanoid:GetPropertyChangedSignal("Sit"):Connect(function()
            Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
        end)
    end)
end)

That would work however I want them to jump when they sit in a certain seat defined as Seat.

What.

Did the print statements work?

i said which ones did in the original post

Here’s how I’d do it

--this must be done locally else it won't work trust me I tried

player = game:GetService("Players").LocalPlayer
Seat = workspace.Seat1

local Character = player.Character or player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Seated:Connect(function()
	
	if Humanoid.SeatPart == Seat then
		Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		print("Humanoid " .. player.Name)
	end
	
end)



I hope this solves your problem be quick to ask any questions if you’d like

Incorrect daddy, it is possable.

Thank you, however I did find a different soultion.

Put this in StarterCharacter:

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid.Seated:Connect(function(seatPart)
 if humanoid.SeatPart.Name == "Seat" then
  humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
 end
end)
1 Like

solution
done on the server side

Seat.Disabled = true -- kicks player out
task.wait()
Seat.Disabled = false
2 Likes

How ??
did you do it on the server side

@ultimate_9k we used the solution sir./madam

Thanks, everyone for the help, this was done for project popsiz. if you have any more questions feel free to message me and I can attempt in explaining.

Roblox staff this topic can be locked.

1 Like