Jump to content

spawn help.


rikimaru263

Recommended Posts

I've been asking the same question and it's solved.

here's the code:

function spawn(player)
 
local spawns = {
{ -2030.1610107422, 172.25221252441, 28.8359375, 270.0 },
{ -1951.3865966797, 703.58880615234, 46.5625 },
{ -1942.5206298828, 486.96841430664, 31.96875 },
{ -2648.3989257813, -28.41300201416, 6.1328125, 179.42449951172 },
{ -2500.03515625, 127.93914794922, 24.475505828857, 88.557006835938 },
{x,y,z,rotZ} -- You can still add more spawns here. to get your current position ingame, just write /gp and copy it in console.
}
 
function spawn( player )
local rnd = math.random( 1, #spawns )
spawnPlayer( player, spawns[rnd][1], spawns[rnd][2], spawns[rnd][3], spawns[rnd][4] ) -- [1] is X, [2] is Y, [3] is Z, and [4] is rotZ.
end -- You will spawn randomly from the coordinates up there everytime you start that resource.
end
 
addEventHandler("onPlayerJoin", root,
function()
     spawn(source)
end
)
 
addEventHandler("onPlayerWasted", root, 
function()
setTimer(spawn, 3000, 1, source) -- You can set when you will spawn again in miliseconds.
end
)

Good luck! ;)

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