General > Developers Corner
New Zombie Idea ( help )
MrPresident:
try moving the timer.Create line to after the function.
Schiaffino:
( i try with another folder and work the sound )
but....
There's a posibility to:
( start the music for 20 seconds. )
and also if there is a way to code that when the NPC Die ,remove the body ? and the music ?like ( self:Remove() for the corpse ? )
MrPresident:
The problem with corpse removal is that Source handles all corpse ragdolls on the client side. There is certainly a way to override that, sure, but that is something I've never played with so I don't know how to do it.
To do the music for 20 seconds before spawning the guard you would need to place another timer inside of the main function that called another function that spawned the guard. You would have to split it up into 2 functions..
1st - Starts music and starts the 20 second timer.
2nd - Spawns the antlion guard.
MrPresident:
Also check out this gamemode hook. Here is how you can do things based on when an NPC is killed.
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7b43.html
You would have to include a check to see what NPC was killed as that hook is called every time an NPC is killed. It's really easy though.. if there is only ONE guard spawned on the map at a time.. just check to see if it's an antlion guard that dies! :)
An Error Has Occurred!
array_keys(): Argument #1 ($array) must be of type array, null given
[0] Board index
Go to full version