class Scoreboard(): file_name = "deaths.txt" def __init__(self): try: file = open(self.file_name, "r") self.deaths = int(file.read()) except: file = open(self.file_name, "w") file.write("0") self.deaths = 0 file.close() def AddDeath(self): self.deaths += 1 def file_update(self): file = open(self.file_name, "w") file.write(str(self.deaths)) file.close() def tostring(self): return "Deaths: " + str(self.deaths)