Jump to content

EDF Spawning


12p

Recommended Posts

ok lets asume that you made a valid edf file and you added the costum spawnpoints using the editor

lets say you edf spawnpoint name is "myspawnpoint" and the editor names the spawnpoints in map file as "myspawnpoint (1)", "myspawnpoint (2)" ect.

to get a position of specyfic spawnpoint:

local x,y,z = getElementPosition(getElementById("myspawnpoint (1)")) 
spawnPlayer (someplayer,x,y,z) 

to get a radnom spawnpoint:

local spawntable = getElementsByType("myspawnpoint") 
local randomspawn = math.random ( 1, table.getn ( spawntable ) ) 
local x,y,z = getElementPosition( spawntable[randomspawn]) 
spawnPlayer (someplayer,x,y,z) 

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