Client-sided animations are very easy to do and the price of not using them can be servere.
You’d have to make a new bool for every attack, whereas with a newproxy() (or incremented number, whichever is easier for you), you only need one.
What’s a use case for animation events where they aren’t outpreformed by other methods? Maybe if you plan on having a time-slow mechanic, but that would be very complicated for a beginner progammer. task.wait() is much easier to understand, adjust, and work with.
You’re telling me that task.wait() is more complex than using an animation event? Let me compare the two:
function Attack1()
task.wait(x)
Hitbox()
end
function Attack2()
AttackAnimation:Play()
local AnimEvent
AnimEvent = AttackAnimation:GetMarkerReachedSignal("DealDamage"):Connect(function()
Hitbox()
--Sure, you could disconnect here, but what if there's multiple DealDamage events?
end)
task.wait(x) --oh wait, we end up using task.wait anyways.. shame.
AnimEvent:Disconnect()
end
I’d also like to point out none of your functions appear to disconnect, causing memory leaks.
Fair point, but if client sided hitboxes were to be used, your system could not send the RemoteEvent early (and then have the client wait based of the time it took for the event to go through) to sync up the hitboxes.
Simple code is great! Until the results needed cannot be given by adjusting the simple code, and you need to rewrite the whole system to be more adaptable anyways.