General > Developers Corner

New Zombie Idea ( help )

(1/3) > >>

Schiaffino:
hi , well im working on a ZOMBIE RP Server.

and i have almost done , i just need 2 things that i dont know how to code.
( if someone know , please help me ;) )

* I Want to make a system that every 30 Minutes the server automatically start a " event " with a zombie music and also, with a BIG Zombie ( Antilon Guard )
* The Server Clean All Corpses
* Zombie's Drop ( Ammo or health kits )

Thanks !

MrPresident:
The first and third are easy.. i'll get you started with some code examples... none of it is tested so take with a grain of salt...



--- Code: ---timer.Create("eventtimer", 1600, 0, EventFunction)

function EventFunction()
     WorldSound( "path/to/music", Vector( 0, 0, 0 ), 160, 100 )

     local ent = ents.Create("npc_antlionguard")
     ent:SetPos(Vector(0,0,0)) -- Change this to where you want the guard to spawn.
     ent:Spawn() -- This method spawns the guard.
end


--- End code ---

Schiaffino:
    little question

 ent:SetPos(Vector(0,0,0)) -- Change this to where you want the guard to spawn.

 ( how can i know a location on the map with vectors ? )

and this function i create a new file on autorun/server ?

MrPresident:
If you have wire installed you can drop down a GPS entity to get the location.. or you can run this in your console...

lua_run_cl Msg(Self:GetPos());

^^Once again.. not sure if that will work.. but something along those lines.. I don't have gmod out here in Afghanistan to test any of this myself.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version