Count wipes in the save
Keep a tally of wipes per island in the player’s save slot.
if not mod.is_server then returnend
-- { ["3"] = 2, ["5"] = 1 }: wipes by victim island. JSON keys are text.mod.on("island_wiped", function(e) local tally = mod.save.get("tally") or {} local key = tostring(e.to) tally[key] = (tally[key] or 0) + 1 mod.save.set("tally", tally) mod.log("island", key, "wiped", tally[key], "times")end)mod.savebelongs to the server VM, so the client returns early.- Save data goes through JSON, where keys are text.
tostring(e.to)makes the island number a key that comes back the same way. getreturns a copy; change it, thensetit again.
The longer version: Save data.