Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- local Delay = 30
- function GAMEMODE:ShowSpare1(pl)
- if GAMEMODE:InRound() && pl:Alive() && (pl:Team() == TEAM_HUNTERS || pl:Team() == TEAM_PROPS) && pl.last_taunt_time + TAUNT_DELAY <= CurTime() && #PROP_TAUNTS > 1 && #HUNTER_TAUNTS > 1 then
- repeat
- if pl:Team() == TEAM_HUNTERS then
- rand_taunt = table.Random(HUNTER_TAUNTS)
- else
- rand_taunt = table.Random(PROP_TAUNTS)
- end
- until rand_taunt != pl.last_taunt
- pl.last_taunt_time = CurTime()
- pl.last_taunt = rand_taunt
- pl:EmitSound(rand_taunt, 100)
- pl.NextTaunt = Delay
- end
- end
- hook.Add("PlayerSpawn","TimeResetter",function(ply)
- if ply:Team() == TEAM_HUNTERS then return end
- ply.NextTaunt = Delay
- ply:SetNWInt("NextTaunt",ply.NextTaunt)
- end)
- timer.Create("TimeCD",1,0,function()
- for k,v in pairs(player.GetAll()) do
- if v:Alive() and v:Team() != TEAM_HUNTERS then
- v.NextTaunt = v.NextTaunt - 1
- v:SetNWInt("NextTaunt",v.NextTaunt)
- if v.NextTaunt <= 0 then
- ShowSpare1(ply)
- v.NextTaunt = Delay
- v:SetNWInt("NextTaunt",v.NextTaunt)
- end
- end
- end
- end)
- end
- if CLIENT then
- surface.CreateFont( "AutoTaunt", {
- font = "Euphemia",
- size = 43,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- } )
- hook.Add("HUDPaint","AutoTaunt",function()
- if not LocalPlayer():Alive() or LocalPlayer():Team() == TEAM_HUNTERS then return end
- surface.SetDrawColor(Color(0,0,0))
- surface.DrawRect( ScrW()-340, ScrH()-150, 330, 140 )
- surface.SetDrawColor(Color(0,200,0))
- surface.DrawRect( ScrW()-330, ScrH()-140, 310, 70 )
- draw.DrawText( "Auto-Taunt", "AutoTaunt", ScrW()-170, ScrH()-60, Color(255,255,255), TEXT_ALIGN_CENTER )
- draw.DrawText( LocalPlayer():GetNWInt("NextTaunt") or 0, "AutoTaunt", ScrW()-170, ScrH()-125, Color(0,0,0), TEXT_ALIGN_CENTER )
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement