Jump to content

x,y,z in table


xTravax

Recommended Posts

hello i tried using some similiar thing

-- not whole script, just an idea in here 
spawnpoints = { 
[1] = -1344.4324,609.234,13, 
[2] = 0,0,2 
} 
-- later on 
setElementPosition(playerElement,spawnpoints[math.random(1,#spawnpoints)]) 
  

this would use just one variable of coordinate in table(?) -- anyway the place where i'd need to spawn was completely wrong

how can i move a player to x,y,z position depending on random spawnpoint in table?

Link to comment

In case you enabled 1.4 OOP, you can simplify it a bit using vectors:

spawnpoints = { 
    Vector3(-1344.4324,609.234,13), 
    Vector3(0,0,2) 
} 
-- later on 
setElementPosition(playerElement,spawnpoints[math.random(1,#spawnpoints)]) 

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