Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function HailTheKing()
- local _PlayersDI = {}
- for _, v in pairs(player.GetAll()) do
- if ( v:GetRole() == ROLE_DETECTIVE and v:Alive() ) then
- table.insert(_PlayersDI, v)
- end
- end
- if ( _PlayersDI == {} ) then
- for _, v in pairs(player.GetAll()) do
- if ( v:GetRole() == ROLE_INNOCENT and v:Alive() ) then
- table.insert(_PlayersDI, v)
- end
- end
- end
- local rply = _PlayersDI[math.random(1,#_PlayersDI)]
- rply:SetMaxHealth(200)
- rply:SetHealth(200)
- rply:SetModel( "models/player/riot.mdl" )
- SuddenBroadcast("Sudden Death: ", Color(255,255,255), "LONG LIVE THE KING!")
- hook.Add("PlayerDeath", "HTK_Punishment", function(ply)
- if ( ply == rply ) then
- SuddenBroadcast("Sudden Death: ", Color(255,255,255), "The King was killed by a Traitor. It´s time to impose a penalty!")
- for k, v in pairs(player.GetAll()) do
- if ( v:GetRole() == ROLE_INNOCENT ) then
- v:SetHealth(1)
- end
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement