From 7854175815e88b0d25cd4f0c0f170602ffb8169f Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Thu, 17 Aug 2017 14:58:30 -0400 Subject: Added methods for weapons to use recorded swings --- gamemode/core/combat/cl_weaponswing.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'gamemode/core/combat/cl_weaponswing.lua') 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 -- cgit v1.2.3-70-g09d2