Author Topic: New Zombie Idea ( help )  (Read 4011 times)

0 Members and 2 Guests are viewing this topic.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
New Zombie Idea ( help )
« on: June 06, 2012, 09:24:27 PM »
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 !
« Last Edit: June 06, 2012, 09:29:05 PM by Schiaffino »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: New Zombie Idea ( help )
« Reply #1 on: June 06, 2012, 09:40:10 PM »
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: [Select]
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


Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Re: New Zombie Idea ( help )
« Reply #2 on: June 06, 2012, 09:47:58 PM »
    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 ?

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: New Zombie Idea ( help )
« Reply #3 on: June 06, 2012, 11:33:30 PM »
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