Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a car become anchored once you get out of it?

I made a car and I want it so it is anchored when you get out of it because the way it is currently is that players can push the car and the car will keep going forward if you jump out of it. Please help. Thank you!

1 comment

1

You could use the touch ended event to detect if the player got out of the car. I'm not sure this is the best way but that's my first idea.

1 answer

✓ Accepted answer

When the seat.Occupant.Jump is set to true, loop through the car and anchor all of the parts.

seat.Occupant just returns the Humanoid that is in the seat at the time. I guess you could also do

seat.Changed:connect(function(prop)
	if prop == "Occupant" and seat.Occupant == nil then
		-- loop through the car and anchor all parts
	end
end)	

Hope I've helped!

9 comments

2

Cool answer!

1

Thank you so much! By the way, is there a limit to how many questions I can ask because there are a lot of things I have been wanting to ask a good scripter?

1

There is no limit, just make sure they are reasonable questions and aren't spam. @BunnyFilms1

1

It will not work. I have the script typed out but when it says "seat" in the script, when I type it it is underlined in blue. What do I do? Also what part of the car do I put the script under?

0

You have to define seat. Seat would be the seat your character sits in inside of your car. Also, don't forget to click "Accept Answer" below my name on this question.

1

I can't find the accept answer button.

0

Where it says "Report to Staff" it should be over there.

1

Lol, it's under his name to the right --->

1

Lol, I am looking but there is no button

This discussion is preserved as it was. New answers, comments, and votes are closed.