Vehicle lock synchronization

Hello,
is there any way to since vehicle lock status between players? Tried both SetVehicleDoorsLocked and SetVehicleDoorsLockedForAllPlayers but still, sometimes vehicle is locked for others when player unlocks it.

Sometimes even when player is in vehicled, other players can’t get in, because it’s locked on their side.

Tried to do it using decors, but did not figure it out.

What would be the best way to make sure vehicle lock is synced between ale the clients?

How are you setting them as locked, namely, are you using a server script to execute the lock native on all client scripts, or are you executing it on just one client?

Adding on to what @ChristopherM is saying, you could always use decorators to sync lock states between clients.

Edit: I’m an idiot and didn’t read the post properly, I managed to get decorators working in my brake lights script, you could look at that and see if it helps. You could set a decorator on the player’s vehicle, then run a check for when another player tries to get in the vehicle, grab the state of the decorator and just either allow or deny the attempted entry.

Here is a link: [Release] Vehicle Brake Lights [1.0.2] [Client Sync] (Updated 2019)

You can store vehicle lock status server side in a table like

lockedVehicles = {
[vehiclePlate] = true,
}

And when unlocking / locking changing state in that table on that specifed license plate?
and when entering getting callback from nearby vehicle, if locked then ClearPedTasksImmedietly i think