For the actual game, cut the medium (the middleperson) out. Just have each person's 5m be taken from their inv and held in a variable (m1[person 1] + m2[person 2] = m3[combined]), when a winner (w) is determined, just add "m3" (the amount of gold from each user combined) to "w"'s inventory. It's simple enough.