Turn Based Attack System

Hello, everyone.

I was wondering how would you go about creating a turn based attack system? So I want to make it so everyone on one side goes then the next side and so on… I would assume this involves tables to see who is in battle and etc but I’m not too sure. Any tips?

Well, you said it right, tables would be a great way to go about this. I’d say storing the players that are in-combat in a table, and depending on their stats (maybe speed), change the Turn Value (IntValue) to a higher or lower number, the ones with the lower number go first. Also a BoolValue to check if it is the Player’s turn. This is just an idea, and there’s probably a million different ways to make this. Either way, good luck!

Just make a table, whoever is first on that table just put them as the person with a turn, then just iterate to the other person etc. till the first round ends then start a second round etc.

The way I do it is put the gamers team (Players) in a table and the enemies in a table. Then i loop through the players and make them play turns and loop through enemies and make them use turn AI. This is my turn based combat system for an upcoming turn based combat RPG that I’m creating. Devlog coming soon:

YT Channel if you want to see some more stuff regarding the combat system:

1 Like