Jump to content

[HELP]Random Spawn


Domingos MTA

Recommended Posts

5 hours ago, Miika said:

function random()
  local x, y = math.random(-2000, 2000), math.random(-2000, 2000)
  local z = getGroundPosition(x, y, 200)
  createObject(9000, x, y, z) --Replace object id with your own
end

 

getGroundPosition

It is required that the point is near enough to the local player so that it's within the area where collision data is loaded. If this is not the case, an incorrect position will be returned

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