You'll have to use lists. If you want to have names and numbers, you'll need 2 lists. Otherwise, just use 1. Each list, when the high scores are reset, should be empty and then filled with 5 or 10 items depending on how many you want. I would recommend 5. When the player finishes the game, he has a specific score. Put this wherever this happens:
ask ["Name?"(you can put a limit on length if you want to keep it more organized)]
insert [answer] at item [1] of [names]
insert [score] at item [1] of [scores]
set [count] to [1]
repeat [5]:
if <[item [count] of [scores]]<[item [count+1] of [scores]]>:
insert [answer] at item [count+2] of [names]
insert [score] at item [count+2] of [scores]
delete item [count] of [names]
delete item [count] of [scores]
end if
change [count] by [1]
end repeat
delete item [6] of [names]
delete item [6] of [scores]
This will add the score and name to the list if it's high enough and will delete the excess score (or just delete this score). To display the scores, you can use variables, stamping, or just show the lists (not recommended).
Offline
[blocks]<if><( <<{Current Score }>><{High Score }>> )>
<set{ High Score}to( <{ Current Score }>
Last edited by PlutoIsHades (2011-09-01 20:27:51)
Offline