From 9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 27 Aug 2016 17:08:46 -0400 Subject: Moved prayers to their own system --- gamemode/shared/itemsystem/weapons/seratedknife.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gamemode/shared/itemsystem/weapons/seratedknife.lua') 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,{ -- cgit v1.2.3-70-g09d2