Adding Sync to Native Functions

These work but aren’t sync’d between players

SetEntityAlpha
SetVehicleDoorsLocked
SetEntityCollision

Does anyone have a working example of how to sync functions between active players, and on join?

2 Likes

topic has been moved, please be careful where you are posting.

Use Entity Decors and make all clients check them and act accordingly.

2 Likes

Trigger a server event which triggers a client event to everyone.

2 Likes

I need an example of such to get started please

Can you provide a sample of such?

I’d actually discourage using server events for that kind of task.

  1. The entity might not exist for every client yet (especially if they are far away).

  2. You’d have to handle clients joining newly afterwards too.

With Entity Decors you’d just have to check what value a decor on an entity has and act accordingly.

1 Like

Take a look at the Decor section in the Natives Reference. You’d specifically have to register a decor. Set the decor on a vehicle with a value once the player did the thing you want.

Then loop through all the clients, check if they are in a vehicle, check if that decor exists and do stuff if it exists.

Thank you @pongo1231, these were my concerns too as I need these to be absolutely coordinated.

Can anyone name an existing decor script that is very wide ranging in applications, or tutorial on such, or best of all a script that uses these on vehicles. I’ve never used decor and can say they are not as readily learnable as other stuff is to me. I learn by seeing things that work best. I need working examples of something I can then shape to do my bidding. :smile:

Can anyone name an existing decor script that is very wide ranging in applications, or tutorial on such, or best of all a script that uses these on vehicles?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.