FlyingSpoon Posted November 2, 2014 Share Posted November 2, 2014 (edited) Hi there I created my robbery script it works perfectly, but now what I want is the marker and blip to spawn in random places all over San Andreas. Any ideas how I can do this? - Removed - Edited November 2, 2014 by Guest Link to comment
Mr_Moose Posted November 2, 2014 Share Posted November 2, 2014 Store all locations in a table: local markersData = { { x, y, z }, { x, y, z }, { x, y, z } -- ... } Then use math.random to choose a random marker: local x,y,z = unpack(markersData[math.random(#markersData)]) I assume you want the player to travel a certain distance and prevent the same marker from appearing as the "finish line", if so you can check the distance this way: local distance = getDistanceBetweenPoints3D( x1,y1,z1, x2,y2,z2 ) 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