Is the car welded? If a person is sitting in a seat it shouldn’t kick them out without there actually being a function to do so.
The humanoid is welded to the seat so if you call Model:MoveTo()
it should move the character/rig also. If you still want to find the humanoid, you can get the seat then use the Seat.Occupant property to get the humanoid. You can get the seat with something like this: script.Parent.Parent.Seat
.
Edit:
HugeCoolboy2007’s script (edited):
local MovePart = script.Parent
local Model = MovePart.Parent.Parent
MovePart.Touched:Connect(function(hit)
if hit.Name == "TouchMovePart" then
local Cframe = Model:GetPrimaryPartCFrame()
Model:MoveTo(Cframe.Position + Cframe.LookVector * 5))
end
end)
That should move the car forward 5 studs and not kick out the character. I don’t use seats very often but I didn’t think setting the CFrame kicked the player. Not sure though. Might have to manually weld the character to the seat.
Ok, the driver getting kicked out is fixed, however, it doesn’t move it 5 studs forward, it moves it to a fixed place for some reason, is there a place in the CFrame part of the script where I need to input a specific position?
(I have never used CFrame apart from now)
I’ve updated the script a bit, from here on out, I should be fine, I ditched the “TouchMovePart”, I realized how long it would take me to input them into every car, moreover, I could just use the main front parts of the car as my own, “TouchMovePart”:
local MovePart = script.Parent
MovePart.Touched:Connect(function(hit)
if hit.Name == “Color” or “Down” or “Grille” or “Headlight” then
hit.Parent.Parent.Parent:SetPrimaryPartCFrame(CFrame.new(10,10,10))
end
end)
Will probably add orientation to it soon.