Jump to content

math.random


myonlake

Recommended Posts

Hello,

I am asking that if I use this function, math.random, and make it like this, for an example:

local id = math.random(0,1000) 
setElementData(player, "example", id) 
setElementData(vehicle, "example", id) 
 

Does it put them both the same ID or just different?

Edited by myonlake
Link to comment

"This function stores element data under a certain key, attached to an element. Element data set using this is then synced with all clients or the server. As such you should avoid passing data that is not able to be synced into this function (i.e. xmlnodes, acls, aclgroups etc.) Server-created elements are able to be synced."

- Adapted from: https://wiki.multitheftauto.com/wiki/SetElementData

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...