Deddalt Posted August 1, 2008 Share Posted August 1, 2008 I recently started learning LUA after becoming proficient in C++ with SA-MP. If anyone knows how to script in C++, you know that: new random = random(number)(number)(number); will select one of the random numbers and assign the variable to that value. I want to know how to do this with LUA so that I can have a random vehicle model spawn when the server starts. Thanks for the help. Link to comment
50p Posted August 1, 2008 Share Posted August 1, 2008 vehicles = { 560, 444, 459, 590 } rnd = math.random( 1, #vehicles ) createVehicle( vehicles[ rnd ], 0, 0, 4 ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now