Player remains Seated after Teleport

I have an issue where players remain seated after they teleport, which can be seen in the attached illustrations below:

RobloxScreenShot20230609_231429524

I have reviewed a few articles on this platform, but none of the solutions work.

Script:

local Players = game.Players:GetPlayers()
local Player = game.Players.LocalPlayer
local Map = game.Workspace.Map:FindFirstChildWhichIsA("Model")
	for i, v in pairs(Players) do
		if v.Team == game.Teams["MALWARE"] then
			if v.Character ~= nil then
				local Character = v.Character
				Character:FindFirstChildOfClass("Humanoid").Sit = false
				v.Character.HumanoidRootPart.CFrame = Map.MALWARESpawn.CFrame + Vector3.new(0,5,0)
			end
        end
    end
end

This snippet (pictured) under the Seat instance says to either force the player to jump or destroy the weld that is created by the seat. Additionally, there exists a “Seated” HumanoidStateType which you can manually re-set to a different state.

…Basically make the player exit the seat before teleporting them

1 Like

Dunno if that works, however you can force the player to jump
This should result in the player ejecting from the seat

Use this code in a LocalScript

local player = game.Players.LocalPlayer
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if humanoid.SeatPart then
	humanoid.Jump = true
end
1 Like

Works well to an extent. I have done a remote event and followed your instructions. However, the physical object of the seat gets teleported along with the player, and the player can “re-seat” themselves if they move around. This is particularly strange as I call the remote event for all players prior to the line where players are teleported.

Try this code the extra line will destroy the SeatPart that gets sent along with the player.

local player = game.Players.LocalPlayer
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if humanoid.SeatPart then
	humanoid.Jump = true
    humanoid.SeatPart:Destroy()
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.