aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/battleaxe.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items/battleaxe.lua')
-rw-r--r--gamemode/itemsystem/items/battleaxe.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/gamemode/itemsystem/items/battleaxe.lua b/gamemode/itemsystem/items/battleaxe.lua
index 96b3cf6..70223c4 100644
--- a/gamemode/itemsystem/items/battleaxe.lua
+++ b/gamemode/itemsystem/items/battleaxe.lua
@@ -1,3 +1,4 @@
+local ITEM = {}
ITEM.Name = [[Battle Axe]]
ITEM.Desc = [[The vikings once used these]]
ITEM.Model = [[models/props_junk/Rock001a.mdl]]
@@ -42,15 +43,15 @@ ITEM.CD = 0.9
function ITEM:OnPrimary(pl,tr)
if (CLIENT) then return end
-
+
if (tr.Hit) then
if (IsValid(tr.Entity)) then
local ent = tr.Entity
local class = ent:GetClass()
-
+
if (class == "player" or class:find("npc_") or class == "ws_pigeon" or class == "ws_prop") then
ent:TakeDamage(self.Damage,pl)
-
+
if (class == "ws_prop") then pl:EmitSound(Sound("physics/wood/wood_plank_impact_hard"..math.random(1,3)..".wav"),100,math.random(90,110))
else pl:EmitSound(Sound("physics/flesh/flesh_impact_hard"..math.random(1,6)..".wav"),100,math.random(90,110)) end
else
@@ -62,4 +63,5 @@ function ITEM:OnPrimary(pl,tr)
else
pl:EmitSound(Sound("weapons/iceaxe/iceaxe_swing1.wav"),100,math.random(60,80))
end
-end \ No newline at end of file
+end
+RegisterItem(ITEM)