Page 1 of 1

How to detect: a player is a driver or a passenger? And if so, what does he drive?

Posted: Thu Dec 15, 2022 11:47 am
by Viidi
How to detect: a player is a driver or a passenger? And if so, what does he drive?

Re: How to detect: a player is a driver or a passenger? And if so, what does he drive?

Posted: Thu Dec 15, 2022 12:03 pm
by Klonan
You can check if he is in a vehicle with : https://lua-api.factorio.com/latest/Lua ... ol.vehicle
And with the vehicle you can get the entity or player who is driving: https://lua-api.factorio.com/latest/Lua ... get_driver
Or the passenger: https://lua-api.factorio.com/latest/Lua ... _passenger