Jump to content

vehicle:getController() yields non-table


frootloopers

Recommended Posts

Hey everyone.

 

I'm trying to apply the accelerator through a lua script, but when I do 
cc = vehicle:getController()
cc:accelerator(true)

It errors out because cc is apparently not a table, when in the lua docs it says getController will yield a CarController.
I have confirmed this as well.

Does anyone have experience manipulating the CarController?

Link to comment
Share on other sites

  • 3 weeks later...

I think what you are looking for is

cc:acceleratorOn(true)

Take a look at:

https://projectzomboid.com/modding/zombie/core/physics/CarController.html


However if you are having trouble with getting the CarController, try and get the vehicle using :getVehicle(), returning the BaseVehicle which you can use :getController() on to get the CarController from the player.

 

Take a look at:

https://projectzomboid.com/modding/zombie/vehicles/BaseVehicle.html#getController()


I'm new to all of this so, sorry if this doesn't help.

Edited by Grimbo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...