Hello everyone i am looking for an improvement to a functional part of the player combat. I have implemented a way which waits for the response and starts playing the animation alongside the ‘Fire’ (which is attachment to an invisible part). At higher ping(330ms) it was too long to be considered ‘fast paced’ therefore i was thinking about a way to “cache”(?) the player or is this too far fetched and have deal with it
Here is an video showing what i am trying to explain. There is a small pause between the actual execution and the spinning.
Track:GetMarkerReachedSignal("StartFiring"):Connect(function(paramString) if paramString == "FireStart" then --"FireStart" is an event when the hands are above the player Track:AdjustSpeed(0) local returns = FirebendRequest:InvokeServer("DeployFire",0) Track:AdjustSpeed(1) end if paramString == "FireEnd" then -- Last frame of the animation Track:Stop() local returns = FirebendRequest:InvokeServer("EndDeployFire",0) ControlModule:Enable() player.PlayerGui:WaitForChild("ScreenGui").Frame.FireSpinCooldown:TweenSize(UDim2.new(1, 0, 0, 20),nil,Enum.EasingStyle.Linear,12,false,callback) player.PlayerGui:WaitForChild("ScreenGui").Frame.FireSpinCooldown.BackgroundColor3 = Color3.new(255,0,0) end end)
Server sided response:
elseif desire == "DeployFire" and userClientstate[player.Name] == 1 then local fire1 = ServerStorage.RightFireSpin:Clone() local fire2 = ServerStorage.LeftFireSpin:Clone() fire1.Parent = player.Character fire2.Parent = player.Character userClientstate[player.Name] = 2 for index = 1,#userToDamage do userToDamage[index]:TakeDamage(10) damageFire = Instance.new("Fire") damageFire.Parent = userToDamage[index].Parent.UpperTorso Debris:AddItem(damageFire,6) userToDamage[index] = nil wait() end return 1