diff options
Diffstat (limited to 'gamemode/shared/itemsystem/weapons/seratedknife.lua')
| -rw-r--r-- | gamemode/shared/itemsystem/weapons/seratedknife.lua | 49 |
1 files changed, 4 insertions, 45 deletions
diff --git a/gamemode/shared/itemsystem/weapons/seratedknife.lua b/gamemode/shared/itemsystem/weapons/seratedknife.lua index a6d4c55..e57351d 100644 --- a/gamemode/shared/itemsystem/weapons/seratedknife.lua +++ b/gamemode/shared/itemsystem/weapons/seratedknife.lua @@ -58,51 +58,6 @@ item.Shape = { --Optional, If this item can be equiped in any player slots, put them here. item.Equipable = "Right" ---[[ returns the direction the player swung]] -local function playermovedir(player) - local vel = player:GetVelocity():GetNormalized() - vel.z = 0 - local swings = { - {player:GetForward(),"forward"}, - {-player:GetForward(),"backward"}, - {player:GetRight(),"right"}, - {-player:GetRight(),"left"} - } - table.sort(swings,function(a,b) - return vel:Dot(a[1]) > vel:Dot(b[1]) - end) - return swings[1][2] -end - -local positionset = {} - -local function swingarc(player,times,positions,onhit) - local positionpoints = {} - table.insert(positionset,positionpoints) - local hitents = {} - for k,v in ipairs(times) do - timer.Simple(v,function() - local weaponpos = positions[k] + player:GetPos() - table.insert(positionpoints,weaponpos) - if #positionpoints > 1 then - local tr = util.TraceLine({ - start = positionpoints[#positionpoints-1], - endpos = positionpoints[#positionpoints], - }) - if tr.Hit then - onhit(tr) - end - end - end) - end - timer.Simple(times[#times],function() - print("Inserted swing, drawn positions are now:") - PrintTable(positionset) - end) -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 @@ -214,5 +169,9 @@ item.onUnEquip = function(self,who) ART.RemovePAC(who,"seratedknife") end +item.onDropped = function(self, ent) + ART.ApplyPAC(ent,"seratedknife") +end + --Don't forget to register the item! ART.RegisterItem(item) |
