How to call a global function?

I’m trying to add a custom command to my server, where I’m doing exactly what I want, I want to call

SetVehicleDoorsLockedForPlayer

but it’s a global function and when I do the command, it spits me this error:

attempt to call a nil value (global 'SetVehicleDoorsLockedForPlayer'

Do I have to add the Proxy thing or Tunnel?

SetVehicleDoorsLockedForPlayer()

Also make sure you’re calling it on client.

1 Like

I’m trying to add a custom command to my server

You cannot call SetVehicleDoorsLockedForPlayer on the server, you need call this exclusively on the client.
The server has no concept on what a vehicle is or a player, so that why you can’t call the function there.

1 Like

Oh I see now, thank you so much for pointing me in the correct direction! :wink:

1 Like