How can I fix this code to spawn multiple types of enemies on the same point with the Corona SdDK? I have this code to spawn a simple enemy outside the window local function spawnGrupo1() local color01 display.newImage("assets img enemigos blue.png") color01.x 40 color01.y 50 physics.addBody( color01, density 5.0, friction 0.0, bounce 0 ) end timer.performWithDelay( 1000, spawnGrupo1, 0) But I want to be able to spawn multiple enemies from that point, and I can't figure it out. I tried this, but it doesn't work local function spawnGrupo1() local numero math.random(1, 3) if numero 1 then local color01 display.newImage("assets img enemigos blue.png") end if numero 2 then local color01 display.newImage("assets img enemigos yellow.png") end if numero 3 then local color01 display.newImage("assets img enemigos red.png") end color01.x 40 color01.y 50 physics.addBody( color01, density 5.0, friction 0.0, bounce 0 ) end timer.performWithDelay( 1000, spawnGrupo1, 0) How can I approach the problem?