Jump to content

[Help] Random spawn


Hope14

Recommended Posts

can i ask you a question did you try to learn?

you could make a table and pick a random coord from it like this:

local randSpawns = { 
  {x,y,z}, 
  {x2,y2,z2}, 
  {x3,y3,z3}    
  -- etc.. you can add more 
} 
  
--and to pick a random one 
  
local randomX, randomY, randomZ = unpack(randSpawns[math.random(#randSpawns)]) 
--and use setElementPosition to set the player position to the random coordinates 

wiki main page for tutorials on how to script https://wiki.multitheftauto.com/wiki/Main_Page

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...