aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/itemsystem/weapons/seratedknife.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-08-27 17:08:46 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-08-27 17:08:46 -0400
commit9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a (patch)
treed65b57e144317e5b49ccdd549b2f97c61d54bd1d /gamemode/shared/itemsystem/weapons/seratedknife.lua
parentd4f197a35c207c9891d3f4dc5e9708af48c935de (diff)
downloadartery-9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a.tar.gz
artery-9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a.tar.bz2
artery-9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a.zip
Moved prayers to their own system
Diffstat (limited to 'gamemode/shared/itemsystem/weapons/seratedknife.lua')
-rw-r--r--gamemode/shared/itemsystem/weapons/seratedknife.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/gamemode/shared/itemsystem/weapons/seratedknife.lua b/gamemode/shared/itemsystem/weapons/seratedknife.lua
index 8571074..a6d4c55 100644
--- a/gamemode/shared/itemsystem/weapons/seratedknife.lua
+++ b/gamemode/shared/itemsystem/weapons/seratedknife.lua
@@ -4,7 +4,7 @@
local item = {}
--Required, a name, all item names must be unique
-item.Name = "Scrap Hammer"
+item.Name = "Serated Knife"
--Optional, a tooltip to display
item.Tooltip = "Bits of scrap put togeather to resembel a hammer"
@@ -105,17 +105,18 @@ end
--Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
item.lastSwing = {}
+local animationtime = 1.833333
item.onClick = function(self,owner)
item.lastSwing[owner] = item.lastSwing[owner] or 0
if item.lastSwing[owner] > CurTime() then
print("returning because item.lastSwing is " .. item.lastSwing[owner], "but Curtime is",CurTime())
return end
- item.lastSwing[owner] = CurTime()+1.25
+ item.lastSwing[owner] = CurTime()+animationtime
local fow,rig,up = owner:GetForward(),owner:GetRight(),owner:GetUp()
local movementtbl = {
["forward"] = function()
owner:SetLuaAnimation("knife_swing_up")
- timer.Simple(2.33,function()
+ timer.Simple(animationtime,function()
owner:StopLuaAnimation("knife_swing_up")
end)
local hits = ART.swingarc(owner,{
@@ -134,7 +135,7 @@ item.onClick = function(self,owner)
end,
["backward"] = function()
owner:SetLuaAnimation("knife_swing_down")
- timer.Simple(2.33,function()
+ timer.Simple(animationtime,function()
owner:StopLuaAnimation("knife_swing_down")
end)
local hits = ART.swingarc(owner,{
@@ -153,7 +154,7 @@ item.onClick = function(self,owner)
end,
["left"] = function()
owner:SetLuaAnimation("knife_swing_left")
- timer.Simple(2.33,function()
+ timer.Simple(animationtime,function()
owner:StopLuaAnimation("knife_swing_left")
end)
local hits = ART.swingarc(owner,{
@@ -172,7 +173,7 @@ item.onClick = function(self,owner)
end,
["right"] = function()
owner:SetLuaAnimation("knife_swing_right")
- timer.Simple(2.33,function()
+ timer.Simple(animationtime,function()
owner:StopLuaAnimation("knife_swing_right")
end)
local hits = ART.swingarc(owner,{