diff options
Diffstat (limited to 'gamemode/shared/itemsystem/weapons/knuckledclaw.lua')
| -rw-r--r-- | gamemode/shared/itemsystem/weapons/knuckledclaw.lua | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/gamemode/shared/itemsystem/weapons/knuckledclaw.lua b/gamemode/shared/itemsystem/weapons/knuckledclaw.lua index 467439e..2db8117 100644 --- a/gamemode/shared/itemsystem/weapons/knuckledclaw.lua +++ b/gamemode/shared/itemsystem/weapons/knuckledclaw.lua @@ -58,49 +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 @@ -197,6 +154,10 @@ item.onUnEquip = function(self,who) ART.RemovePAC(who,"knuckledclaws") end +item.onDropped = function(self, ent) + ART.ApplyPAC(ent,"knuckledclaws") +end + print("Hello from scrapgun.lua") --Don't forget to register the item! ART.RegisterItem(item) |
