Hey there,
I’m trying to make something where when you touch a part if you are sitting it will kick you out of the seat and teleport you somewhere else but I cannot figure out how to do this.
Any help is appreciated!
Hey there,
I’m trying to make something where when you touch a part if you are sitting it will kick you out of the seat and teleport you somewhere else but I cannot figure out how to do this.
Any help is appreciated!
Humanoids have a sit property. You can do the following to unseat the Humanoid, then teleport them.
local char = -- make this the character of the person you want to preform the action on
char.Humanoid.Sit = false
char.HumanoidRootPart.CFrame = -- make this the CFrame of wherever you're teleporting them to
Oh wow, Thank you so much I never realized till now that I could edit the sit property via script but this helped a lot thanks!
humanoid:SetStateEnabled(Enum.Humanoid.Seated, false)
task.wait()
humanoid:SetStateEnabled(Enum.Humanoid.Seated, true)
local seatPart = humanoid.SeatPart
if seatPart then
local seatWeld = seatPart:FindFirstChild"SeatWeld"
if seatWeld then
seatWeld:Destroy()
end
end
humanoid.Jump = true