Hello, i have question it is possible to make “press key to exit the car”?
Of course, you can use UserInputService to detect when a key is pressed and have a function linked up to it to exit a car when said key is detected. Though for the future I highly recommend you add more detail to your question as it is very open ended.
Not sure if this works, but maybe you can eject the Occupant if you call Seat | Roblox Creator Documentation without a specified humanoid (so without any arguments).
Yeah, but i used Proximity Prompt to enter the car.
Doesn’t mean you cannot implement basic User Input to then leave the car. If you really wanted to, while I don’t advise you could also just use Proximity Prompt again to exit the car and just hook it to an exit function.
You can use Proximity Prompet. Such as this tut on DutchDevs channel ROBLOX | How to use Proximity Promts - YouTube
Yes, but i used it. I need to create script which allows you to get out of the car.
What exactly is your issue with creating said script then? Again you need to be much more detailed in your posts for anyone to accurately give you advice. Also keep in mind this is for help, not for someone to write code for you.
I set the jump power to 0, set Humanoid.Jump to true, then set the jump power back to the original value to get a humanoid out of a seat.
As @OneLegitDev said, you should probably use the UserInputService. Here is a general framework for using the UserInputService:
- LocalScript in starter character
- Detect when the Humanoid state changes to sitting
- Use the UserInputService to cause the humanoid to jump with a power of zero (described above) when a key is pressed if the Humanoid is sitting (you can either use the connection above to control a variable (easy) or connect and disconnect the UserInputService connection based on changes in the humanoid state (more complex))
Thanks for your help.I will use it