Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cvar = CreateConVar("allow_attack", "1")
- local once
- local blacklist =
- {
- "weapon_crowbar",
- }
- local function Allow(bool)
- for key, ply in pairs(player.GetAll()) do
- for key, wep in pairs(ply:GetWeapons()) do
- if table.HasValue(blacklist, wep:GetClass()) then
- local t = bool and CurTime() or CurTime() + 10
- wep:SetNextPrimaryFire(t)
- wep:SetNextSecondaryFire(t)
- end
- end
- end
- end
- timer.Create("allow_attack", 0, 0, function()
- local A = cvar:GetBool()
- if A then
- if not once then
- Allow(true)
- once = true
- end
- else
- Allow(false)
- once = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment