• Round Script
    8 replies, posted
  • Avatar of rebel1324
  • [lua] -- This addon is made by Black Tea a.k.a rebel1324 in FP. MAX_ROUNDS = 3 local CurRound = 0; function ROUND_REACHED() -- Add some event when Current Round Reach the Max Rounds. -- If you have map vote thing, add it. -- If you need to change specific map, just add here. ROUND_MESSEGE( "Max Round reached. Calling Round End Event." ) end function ROUND_MULTIPLAYER() if (#player.GetAll() == 2) then ROUND_MESSEGE( "Starting New Round in few seconds." ) timer.Simple(8, function() ROUND_RESTART(); end); end; end --hook.Add("PlayerInitialSpawn", "ROUND_MP", ROUND_MULTIPLAYER) function ROUND_END() ROUND_MESSEGE( "New round starting. Prepare." ) timer.Simple(5, function() ROUND_RESTART(); end); end function ROUND_RESTART() game.CleanUpMap(); -- Reset all map entities. if you don't want it, just delete this line. -- Add some event when new round start. for k, v in ipairs(player.GetAll()) do v:Spawn() end; if (MAX_ROUNDS == CurRound) then ROUND_REACHED() end; CurRound = CurRound + 1; end function ROUND_MESSEGE( say ) for k, v in ipairs(player.GetAll()) do v:PrintMessage(HUD_PRINTTALK, tostring(say)); end; end [/lua] Simple round script for gamemode. It will be help for lazy ppl. [editline]12th May 2011[/editline] Oops I missed one. [lua] function ROUND_MULTIPLAYER() if (#player.GetAll() == 2) then ROUND_MESSEGE( "Starting New Round in few seconds." ) timer.Simple(8, function() ROUND_RESTART(); end); end; end --hook.Add("PlayerInitialSpawn", "ROUND_MP", ROUND_MULTIPLAYER) [/lua] is for team based gamemode or TTT like games.
  • [QUOTE=sniperlover;29776853]It'll only work with 2 players. [lua] if (#player.GetAll() == 2) then [/lua][/QUOTE] No, that's to check when a new player has joined the game so a new round can be started - for team based games.
  • Avatar of ralle105
  • Nice and simple. This bugs me though [lua] timer.Simple(5, function() ROUND_RESTART(); end); [/lua] Just do [lua] timer.Simple(5,ROUND_RESTART) [/lua]
  • Avatar of rebel1324
  • [QUOTE=gotskilz4u;29786370]Thanks.[/QUOTE] Not really. anyone can make it in an hour. that is really easy for all of us. This script is just for lazy ppl who are really lazy to make it. (liek me.)
  • Avatar of rebel1324
  • [QUOTE=Zoey Artyom;29792845]Im pretty sure you spell Message like that, not Messege :3: But it looks good to go.[/QUOTE] Dang it. another typo... like 'assult'