-- serverbomb.lua by Green -- based off of Funny tf2 video Zyphyr sent local kaboom = false local kaboomer = "" local kablooey = false local ticwait = 35 -- hud "flags" ig, idk how to work huds :cry: local redtint = false local whiteboom = false CV_RegisterVar({name = "explodeserver_beeps", defaultvalue = "3", flags = 4, PossibleValue = CV_Natural}) local beeps = CV_FindVar("explodeserver_beeps").value addHook("NetVars", function(net) kaboom = net($) kaboomer = net($) kablooey = net($) ticwait = net($) redtint = net($) whiteboom = net($) beeps = net($) end) COM_AddCommand("explodeserver", function(plr, a, b) if ((not a) or a:lower() ~= "y") and ((not b) or b:lower() ~= "n") then CONS_Printf(plr, "\x82* Are you sure you want to explode the server?\n\x83* Enter the command 'explodeserver y' to confirm.\x80") return end if (a and a:lower() == "y") and ((not b) or b:lower() ~= "n") then CONS_Printf(plr, "\x82* It'll create a lot of debris, and cost a lot to fix!\n\x87* 'explodeserver y n' to confirm.\x80") return end if a:lower() == "y" and b:lower() == "n" then beeps = CV_FindVar("explodeserver_beeps").value kaboom = true kaboomer = plr.name CONS_Printf(plr, "\x85* Farewell.\x80") return end end, COM_ADMIN) local function explodeServer() kablooey = true if isdedicatedserver then print("//////////////////////////////\n\nYour server was exploded by the admin \""..kaboomer.."\".\nSorry!\n\n//////////////////////////////") COM_BufInsertText(consoleplayer, "quit") end if isserver then COM_BufAddText(server, "exitgame") end end local function hudJank(v) if redtint == true then v.drawFill(0, 0, 500, 300, 35|V_TRANSLUCENT|V_SNAPTOLEFT|V_SNAPTOTOP) v.drawString(160*FRACUNIT, 100*FRACUNIT, "SERVER EXPLOSION IMMINENT", nil, "fixed-center") end if whiteboom == true then v.drawFill(nil, nil, nil, nil, 0) end end addHook("ThinkFrame", function() if kaboom == true and kablooey == false then if ticwait == 0 then if redtint == true then redtint = false ticwait = 18 elseif beeps > 0 then redtint = true S_StartSound(nil, sfx_buzz3) beeps = $ - 1 ticwait = 17 elseif whiteboom == false redtint = false whiteboom = true S_StartSound(nil, sfx_bkpoof) ticwait = 9 else explodeServer() end else ticwait = $ - 1 end end end) addHook("IntermissionThinker", function() -- no escape if kaboom == true and kablooey == false then if ticwait == 0 then if redtint == true then redtint = false ticwait = 18 elseif beeps > 0 then redtint = true S_StartSound(nil, sfx_buzz3) beeps = $ - 1 ticwait = 17 elseif whiteboom == false redtint = false whiteboom = true S_StartSound(nil, sfx_bkpoof) ticwait = 9 else explodeServer() end else ticwait = $ - 1 end end end) addHook("MapLoad", function() if kablooey == true then kaboom = false kaboomer = "" redtint = false whiteboom = false beeps = CV_FindVar("explodeserver_beeps").value ticwait = 35 kablooey = false end end) hud.add(hudJank, "game") hud.add(hudJank, "scores") hud.add(hudJank, "title") hud.add(hudJank, "titlecard") hud.add(hudJank, "intermission")