diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2017-08-17 14:58:30 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2017-08-17 14:58:30 -0400 |
| commit | 7854175815e88b0d25cd4f0c0f170602ffb8169f (patch) | |
| tree | 5d03fe92d59a92df6bad9f09083e470a5b23ccfc /gamemode/core/combat/cl_weaponswing.lua | |
| parent | 77b2974db2a719fbc92734cc88df73b1f1c41b0a (diff) | |
| download | artery-7854175815e88b0d25cd4f0c0f170602ffb8169f.tar.gz artery-7854175815e88b0d25cd4f0c0f170602ffb8169f.tar.bz2 artery-7854175815e88b0d25cd4f0c0f170602ffb8169f.zip | |
Added methods for weapons to use recorded swings
Diffstat (limited to 'gamemode/core/combat/cl_weaponswing.lua')
| -rw-r--r-- | gamemode/core/combat/cl_weaponswing.lua | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gamemode/core/combat/cl_weaponswing.lua b/gamemode/core/combat/cl_weaponswing.lua index 54f7dee..74365b1 100644 --- a/gamemode/core/combat/cl_weaponswing.lua +++ b/gamemode/core/combat/cl_weaponswing.lua @@ -24,6 +24,10 @@ local tracking = false local animent local swingtodraw = nil +net.Receive("artery_setswingdebug",function() + swingtodraw = net.ReadTable() +end) + hook.Add("PreDrawTranslucentRenderables","draw_wepswing",function() local lpp = LocalPlayer():GetPos() if swingtodraw ~= nil then @@ -34,6 +38,17 @@ hook.Add("PreDrawTranslucentRenderables","draw_wepswing",function() end end) +net.Receive("artery_weaponswing",function() + local animname = net.ReadString() + local who = net.ReadEntity() + local duration = net.ReadDouble() + who:SetLuaAnimation(animname) + timer.Simple(duration,function() + who:StopLuaAnimation(animname) + end) + +end) + net.Receive("artery_doanimation",function() local animname = net.ReadString() local animtime = net.ReadDouble() @@ -61,7 +76,7 @@ net.Receive("artery_doanimation",function() who:StopLuaAnimation(animname) net.Start("artery_notifyserverofswing") net.WriteString(wepname) - net.WriteString(animname) + net.WriteString(animdir) net.WriteTable(swingtbl) net.SendToServer() swingtodraw = swingtbl |
