How to make a combat system?

Heyo I’m trying to work on combat for my game and if I’m being honest I’m kind of losing my mind LOL everything is just so messy so looking for some help on how I could make a good combat system.

So first of all very basic implementation of my code so far would be
Player does input → FireServer → Server checks if the player hit something using Region3 → If it did hit something then get the target → Check if the target is blocking → Do damage and add stun if it’s not blocking

I track stun by adding a Stun value in the players characters/npcs not sure if this is the best way to go, but it’s easier so yeah.

and then yeah that’s basically what I’m doing in my code and I think that’s mostly all you have to do so my real issue starts to come in with what do I do with the client after or like how can I update the clients guis I currently just have a GetPropertyChangedSignal setup and then it tweens which the result is this

Which is cool I guess, but I don’t want the red bar to instantly go down I wanna wait until you haven’t been attacked for about 2-3 seconds and then with the sun bar if you haven’t been touched for the same amount of time then it starts to decrease.

Rereading this I’m realizing it’s very confusing, but I’m really tired and annoyed so sorry anyways if anyone whos good with doing combat could give me some tips that would be cool.

3 Likes