• Simple Round system Gmod 13
    4 replies, posted
I want a simple round system when team 0 is dead , that the round restarts [IMG]http://cloud.dloaded.com/i/52b1c22e707ee.gif[/IMG] I have a clue on how to script this , but i have no clear clue on making it Help me ! Thx ! Regards sm69baller [highlight](User was banned for this post ("Wrong section / weird" - Craptasket))[/highlight]
If you Google "Acecool Round site:facepunch.com" you should find 2 or more threads where I made a "mock" round-system which does what you're asking. You may need to finalize it ( rules ), but it should be what you're looking for.
[lua]hook.Add( "PlayerDeath", "", function( ply, inflictor, attacker ) local teamdead = true -- pretend all players are dead for k, v in pairs( team.GetPlayers( 1 ) ) do -- assuming the team you want to check has the index "1" if v:Alive() then teamdead = false end -- if a single one is alive then reverse it end if teamdead then round_restart() -- if it's still true (ie all players are dead) then run the restart round function end end )[/lua] I posted this a while back to help someone with a similar problem, I've modified it to suit your needs. Also, this is how I would restart the round: [lua]function round_restart() game.CleanUpMap() -- reset the map for k, v in pairs( player.GetAll() ) do v:KillSilent() -- kill all players without the pesky death sounds v:Spawn() -- Respawn all players end end [/lua] I hope this helped.
whats with the creepy obnoxious gif. if you want somebody to spoon-feed you, you can find coders at [URL="http://www.coderhire.com"]www.coderhire.com[/URL].
Sorry, you need to Log In to post a reply to this thread.