aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/crystalpickaxe.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-12-28 18:46:17 -0600
committerAlexander Pickering <alexandermpickering@gmail.com>2016-12-28 18:46:17 -0600
commit0ceb38e8a1f26716fe4756c1cfbdbbedd1fae5f1 (patch)
tree6f9d24d0785a913e2baa38fec3a24d5dfb4d1d1b /gamemode/itemsystem/items/crystalpickaxe.lua
parent52fb13ef163bcea7f1409e17fd62509703de9f69 (diff)
downloadwintersurvival2-0ceb38e8a1f26716fe4756c1cfbdbbedd1fae5f1.tar.gz
wintersurvival2-0ceb38e8a1f26716fe4756c1cfbdbbedd1fae5f1.tar.bz2
wintersurvival2-0ceb38e8a1f26716fe4756c1cfbdbbedd1fae5f1.zip
Fixed some stuff
Diffstat (limited to 'gamemode/itemsystem/items/crystalpickaxe.lua')
-rw-r--r--gamemode/itemsystem/items/crystalpickaxe.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/gamemode/itemsystem/items/crystalpickaxe.lua b/gamemode/itemsystem/items/crystalpickaxe.lua
index 8c981e1..7e3f127 100644
--- a/gamemode/itemsystem/items/crystalpickaxe.lua
+++ b/gamemode/itemsystem/items/crystalpickaxe.lua
@@ -1,4 +1,4 @@
-
+local ITEM = {}
ITEM.Name = "Crystal Pickaxe"
ITEM.Class = "weapon"
ITEM.Desc = "An advanced crystal pickaxe. More efficient than an ordinary pickaxe."
@@ -12,7 +12,7 @@ ITEM.Structure = {
Size = Vector(0.1,1,0.4),
Pos = Vector(3,-1,-27),
Ang = Angle(0,0,0),
- },
+ },
{
Bone = "ValveBiped.Bip01_R_Hand",
Model = "models/props_debris/wood_board02a.mdl",
@@ -42,15 +42,15 @@ ITEM.CD = 0.4
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
elseif (ent:IsRock()) then
@@ -58,7 +58,7 @@ function ITEM:OnPrimary(pl,tr)
if (math.random(1,55)/10 < 2) then pl:AddItem("Crystal",1) end
if (math.random(1,90)/10 < 1) then pl:AddItem("Diamond",1) end
if (math.random(1,90)/10 < 2) then pl:AddItem("Flint",1) end
-
+
pl:EmitSound(Sound("physics/concrete/rock_impact_hard"..math.random(1,6)..".wav"),100,math.random(90,110))
else
pl:EmitSound(Sound("physics/surfaces/sand_impact_bullet"..math.random(1,4)..".wav"),100,math.random(90,110))
@@ -70,3 +70,4 @@ function ITEM:OnPrimary(pl,tr)
pl:EmitSound(Sound("weapons/iceaxe/iceaxe_swing1.wav"),100,math.random(90,110))
end
end
+RegisterItem(ITEM)