I want to do things like toggling a trail on/off, or trigger other graphical effects for an attack, but firing 3 different remote events to turn on the trail, activate the hitbox, then turn off the trail, is obviously really silly and unoptimal.
For example with a punch, what I’m doing right now is this:
FistPunch1:GetMarkerReachedSignal('AnimStart'):Connect(function()
Humanoid:SetAttribute("Attacking", true)
PunchCooldown = true
Humanoid.WalkSpeed += 12
end)
FistPunch1:GetMarkerReachedSignal('PunchHit'):Connect(function()
FistPunchRE:FireServer(CurrentAttack)
Humanoid.WalkSpeed -= 20
wait(0.5)
Humanoid.WalkSpeed += 8
end)
FistPunch1:GetMarkerReachedSignal('AnimEnd'):Connect(function()
CurrentAttack = 2
wait(0.3)
Humanoid:SetAttribute("Attacking", false)
PunchCooldown = false
end)
What I thought the next solution would be was to replicate the animations to everyone with FireAllClients (since this would also further reduce lag by running anims client sided) and then using the animation events there, but that seems like a bit of a commitment and I’m not 100% sure how that is set up (I get the concept, but execution is always harder)
If you could explain a good or easier alternative, or link me to any resources that might be helpful, that’d be great