[Solved] Can someone help me figure this out?

On the first game development island (level 14) it won’t spawn what I’ve typed in for code.

Here is my program so far.

// Skeletons are afraid of lightstones.

var player = game.spawnHeroXY("champion", 15, 35);
player.attackDamage = 60;
player.maxSpeed = 8;

game.addSurviveGoal();
game.addDefeatGoal();

// Spawn a "generator"
game.spawnXY("generator",21,20)
generator.spawnDelay=5
generator.spawnType="skeleton"
generator.maxHealth=100
// Spawn a "lightstone"
game.spawnXY("lightstone",65,52)
// Now beat your game!

(As you can see, the specifics for a hero to spawn was already put in place. I set for the generator to be spawned, but that didn’t even appear either. I feel like I’m overlooking something…)

1 Like

Can you preformat your code according to the FAQ? :slightly_smiling_face:
https://discourse.codecombat.com/faq

1 Like

I THINK so. Is this good? I didn’t realize the grey box around the code was so important. lol

1 Like

FYI in JavaScript always add a semicolon at the end for every code.

I wanted it formatted for lua :grinning:

1 Like

Then instead of var use local

It still says that it is incorrect. :frowning:

1 Like

Can you take a screenshot of the error?

1 Like

Ohh! You are now doing python! To change go to game menu and change your programming language to Lua!

1 Like

Oh! Haha. Had a blonde moment. Thanks!

1 Like