Endershot355
Steampunker
ahh thanksLook at your code:
You're closing your class before your put the function in. Fix: Move that closing bracket below your CanSpawn function.Code:public class Haunted : ModNPC { public override void SetDefaults() { npc.name = "Haunted"; npc.displayName = "The Haunted"; npc.width = 52; npc.height = 60; npc.damage = 200; npc.defense = 33; npc.lifeMax = 6000; npc.soundHit = 1; npc.soundKilled = 1; npc.value = 60f; npc.knockBackResist = 0.5f; aiStyle = 40; } } // <--- Right over here public override float CanSpawn(NPCSpawnInfo spawnInfo) { if(((myModPlayer)spawnInfo.player.GetModPlayer(mod, "myModPlayer")).accessoryOn== true) // That last ; here is not supposed to be there! { return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 5f : 0f; } return 0f; }
[DOUBLEPOST=1457607276,1457607237][/DOUBLEPOST]the name aiStyle does not exist in the current context