Skip to content

Commit

Permalink
Crate Wars: Make sure crates break in one hit
Browse files Browse the repository at this point in the history
  • Loading branch information
FluffyXVI committed Apr 16, 2019
1 parent 295a35d commit 99b4368
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fluffy_cratewars/gamemode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ hook.Add("Tick", "TickCrateSpawn", function()
end )

function GM:EntityTakeDamage(target, dmginfo)
if !target:IsPlayer() then return end

if GAMEMODE.CratePhase then
dmginfo:SetDamage(0)
local vec = dmginfo:GetDamageForce()
target:SetVelocity(vec*10)
if target:IsPlayer() then
dmginfo:SetDamage(0)
local vec = dmginfo:GetDamageForce()
target:SetVelocity(vec*10)
else
dmginfo:SetDamage(500)
end
else
return
end
Expand Down

0 comments on commit 99b4368

Please sign in to comment.