Legacy GM [Newbie] Changing sprites at spawn

M

Mauricio Antunes

Guest
I have an object that i need to change it sprite when it spawns.
I tried to do it but didn't work
//create event
eggform = random_range(1,9)

//step event
if (eggform = 1){draw_sprite(spr_chocolateegg,-1,0,0)}
if (eggform = 2){draw_sprite(spr_whitechocoegg,-1,0,0)}
if (eggform = 3){draw_sprite(spr_crunchyegg,-1,0,0)}
if (eggform = 4){draw_sprite(spr_mixedegg,-1,0,0)}
if (eggform = 5){draw_sprite(spr_strawberregg,-1,0,0)}
if (eggform = 6){draw_sprite(spr_crunchywegg,-1,0,0)}
if (eggform = 7){draw_sprite(spr_fineblckegg,-1,0,0)}
if (eggform = 8){draw_sprite(spr_finewegg,-1,0,0)}
if (eggform = 9){draw_sprite(spr_scaleyegg,-1,0,0)}

And didnt work, i tried before with sprite_index but didn't work either.
Can someone help me? ^^
 
J

JFitch

Guest
draw_sprite is definitely wrong, as it is only used in the Draw event.

sprite_index should work. Show the code that you used for that.
 
M

Mauricio Antunes

Guest
draw_sprite is definitely wrong, as it is only used in the Draw event.

sprite_index should work. Show the code that you used for that.
Thank you for the help =D i got it with another answer thank you for the attention =D
 
Top