ID:273630
 
Hi.

I am trying to incorporate a scoring system in my game, A Day At The Races, to show which players have the most money, and which players have lost the most money during bets. I tried following Lummox Jr's post on the topic, and adapting the code to suit my game. However, i failed. Miserably.

Everytime it tries to record scores, it states that the hub could not be contacted to record the scores.

I was wondering if anyone could provide me with a snippet of code that should, in theory work.

Variables:
money
money_lost

Please note that my savefile system is a client-side savefile system, but i did not know if that would affect it or not.

Thank you in advance to anyone who can give help :)
UPDATE

Ok, so i realised i need a hub password. Added that in, and i get the bug-report message that confirms that the score was stored. however, it does not appear on the hub.

mob/proc/RecordResults(money, money_lost)
spawn(-1)
var/list/records
var/result = world.GetScores(key, "")
if(isnull(result))
src << "Sorry, the hub could not be contacted to record your score."
return
records = params2list(result)
var/list/new_records = new
new_records["Money"] = max(money, text2num(records["Money"]))
new_records["Money Lost"] = max(money_lost, text2num(records["Money Lost"]))
if(world.SetScores(key, list2params(new_records)))
src << "Stored."