From b8459ff6667e3dcba13163c42a205f6a8ede9da5 Mon Sep 17 00:00:00 2001 From: relaxtakenotes <134127331+jeffthekillerz@users.noreply.github.com> Date: Sat, 3 Jun 2023 20:47:30 +0500 Subject: [PATCH] hacky player damage fix --- .../gamemode/player_class/player_beatrun.lua | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/beatrun/gamemodes/beatrun/gamemode/player_class/player_beatrun.lua b/beatrun/gamemodes/beatrun/gamemode/player_class/player_beatrun.lua index 1ce09bc..081759c 100644 --- a/beatrun/gamemodes/beatrun/gamemode/player_class/player_beatrun.lua +++ b/beatrun/gamemodes/beatrun/gamemode/player_class/player_beatrun.lua @@ -302,21 +302,26 @@ end) hook.Add("ShouldCollide", "NoPlayerCollisions", function(ent1, ent2) if ent1:IsPlayer() and (ent2:IsPlayer() or ent2.NoPlayerCollisions) then - if ent2.BRCollisionFunc then return ent2:BRCollisionFunc(ent1) - else return false end + if ent2.BRCollisionFunc then + return ent2:BRCollisionFunc(ent1) + else + if ent1.br_Fired or ent2.br_Fired then + return true + end + + return false + end end - -- if ent1:IsPlayer() and (ent2:IsPlayer() or ent2.NoPlayerCollisions) then - -- if ent2.BRCollisionFunc then - -- return ent2:BRCollisionFunc(ent1) - -- else - -- return false - -- end - -- end - if ent2:IsPlayer() and ent1:IsNPC() then return true end end) +// i was forced +hook.Add("EntityFireBullets", "thisengineismadebyacrackhead", function(ent, data) + ent.br_Fired = true + timer.Simple(engine.TickInterval()*2, function() if IsValid(ent) then ent.br_Fired = false end end) +end) + hook.Add("PhysgunPickup", "AllowPlayerPickup", function(ply, ent) if ply:IsSuperAdmin() and ent:IsPlayer() then return true end end)