Thanks @John Sandoval for the code. I didn't know how to use a external file in the code and about data structure, but thanks to you i learn it (after reading the Game Maker Help just to understand the code you put it

)
But after i read your code, i found an error. Is that part:
//sets up a while loop that checks the value of the current score with every single one of the high scores.
a=0 //the current ranking of the score being checked. it starts at 0 because data grid numbering starts at 0
while a<5 //while a<the number of items in the data grid
{
if game_score>ds_grid_get(score_grid,0,a)//if the score is higher than this number
{
b=4
//this code slides down all the values of the high scores. so if your score is
//the new highest score, score 5 is set to score 4, score 4 is set to score 3, etc.
while b>=0
{
ds_grid_set(score_grid,0,b,ds_grid_get(score_grid,0,b-1))
b-=1
if b=0
break;//if you've run through all the numbers, QUIT
}
ds_grid_set(score_grid,0,a,game_score)
break;//if you've set the new score, QUIT
}
a+=1
}
In that code say that when a high-score is surpassed, always will overwrite
all the high-score list and after that, it will overwrite again the position deserved. For example:
Before the game the high-score list is:
And in the game we got a score of 30, so correspond the 3th place. But after the high-score update we got...:
- 1. 45
- 2. 45
- 3. 30
- 4. 25
- 5. 15
So, i made some changes in the code (yeah, i learned it

):
//sets up a while loop that checks the value of the current score with every single one of the high scores.
a = 0;//the current ranking of the score being checked. it starts at 0 because data grid numbering starts at 0
while (a < 5 && highScoreCheck == 0) //while a < the number of items in the data grid and the high-score list isn't updated
//highScoreCheck is created in the Create Event
{
if (score > ds_grid_get(score_grid, 0, a))//if the score is higher than this number
{
b = 4;
//this code slides down the values of the high scores. so if your new score is
//one of the highest scores, score 5 is set to score 4, score 4 is set to score 3, etc.
//until reach the place deserved.
while (b > a)
{
ds_grid_set(score_grid, 0, b, ds_grid_get(score_grid, 0, b - 1));
b -= 1;
}
ds_grid_set(score_grid, 0, a, score);
highScoreCheck = 1;
}
else a += 1;
}
And of course i organized it, for better reading. Now it runs nicely. But i only will put 1 high score on the list, because is single player.
Any way, i learn it to code it so thanks you
