ID:272729
 
I was wondering if anyone could tell me and give me an example of how a battle system would be coded. It would be greatly appreciated if you would.
Considering the fact that every game will most likely want combat to work in its own way, you really aren't going to get much help out of someone handing you something ready-made.

What you need to do is sit down and think about how you want combat to work, in theory. How do players perform attacks? Do they push buttons, what do those buttons do? Do you want turn-based combat, realtime combat? Do players avatars attack eachother automatically or are all attacks initiated by the player? What formulas determine how hard a player hits, can players dodge? can they block with a shield? et cetera.

Once you've thought the system through, you can begin translating these things into code.
it's all dependent on what sort of battle system you want, considering you're starter i'd suggest making one with simple Death, Attack, Respawn Procs.