Im currently trying to make a npc not sit in a seat because when it follows me it just gets stuck in it
I’ve been looking at some solutions but nothing worked
Heres the code
wait(1)
local character = script.Parent
character.Torso.Touched:Connect(function(hit)
if hit:IsA("Seat") then
hit:Destroy()
else
end
end)
I think the best solution for you, rather then listening for the Torso to be touched and destroying it if it’s a seat, is to simply disable the NPC from sitting.
This can be done using the Humanoid's SetStateEnabled method. script.Parent.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Seated, false)
hit.CanCollide = false -- turn off seat
character.Humanoid.Sit = false -- force humanoid to stand
wait(1) -- let the NPC get away from the seat
hit.CanCollide = true -- turn the seat back on