Jump to content

Spawn point problem


asd123

Recommended Posts

Hey all i was making a Cops and robber map but then i had a problem i need to make a certain vehicle spawn point the first spawn point a person spawns with. For example there could be a server with 5 people on and 100 spawn points 99 of the spawns are police cars and 1 is the robber spawn i need to make the robber spawn the first spawn so 1 of the 5 people on the server will get a robber car and the rest police. How can i do this?

Link to comment

Well in the script you would first need to loop through the map file with all the vehicles being spawned,

while looping through it, you could get the positions of them, store them in to a table and destroy the vehicle.

After that's done, when ever a player joins the server and they're the police then use this:

local x,y,z = unpack(tableName[math.random(1,#tableName)] --The table would basically look like this: local tableName = {{x,y,z}} 

to get the random position of a police car, after just send them to that position and warp them into the car.

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