Hey, I got a gamemode going, and I have been in look of a player ammount based function
like,
if players = 2 then
and all that.
if players = 1 then do
PrintMessage(4, "Wave I - Zombies! - round time 2 minutes!")
timer.Create( "Wave1", 1, 1, function()
timer.Create( "Respawner", 15, 6, function()
if ( numZombies < maxZombies ) then
for k, v in pairs( ZombieSpawnPoints ) do
activator:EmitSound("music/HL1_song11.mp3", 500, 100)
local zombie = ents.Create( "npc_mczombie_revised" )
zombie:SetPos( v.pos )
zombie:SetCollisionGroup( 2 )
zombie:Spawn()
zombie:Activate()
numZombies = numZombies + 1
end
end
end )
end )
end
Trying to get something like that to run on if there are 1 or more players,
and help ?
#player.GetAll() returns the amount of players on a server.
I strongly suggest taking a look at wiki.garrysmod.com, it's very helpful.
Sorry, you need to Log In to post a reply to this thread.