GML Trying to index a variable which is not an array

S

SethDoesSomeStuff

Guest
I'm still very new to Game Maker Studio, but there's a competition running at my school so I thought I'd give it a go. I'm trying to create a scoreboard for my endless runner; once you run out of lives, you're sent to the scoreboard and told to enter your name. I've had this error whenever I run out of lives:


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_draw_scores:

trying to index a variable which is not an array
at gml_Object_obj_draw_scores_DrawEvent_1 (line 11) - draw_text(xx, yy, string(global.score_array[i, 0]))
############################################################################################


Any help would be much appreciated, sorry if it's something completely stupid, I've just been following a tutorial on YouTube.
 

Attachments

sp202

Member
I recommend posting the code as plain text next time, easier to read for some folks and more convenient for everyone. I can't see anything wrong with the code you've posted per se, but clearly there's an issue with the declaration of the array, could you post the code for that?
 

matharoo

manualman
GameMaker Dev.
Look through your code and make sure your array is being declared before this code runs.
 
Top