Hello welcome to my Why wont this code work thread. here you can post code that is not working for you and maybe someone will help you here is some code that is not working for me also this code is in my npc code
private int timer = 600;
private int framecount = 0;
public new void OnUpdate(Player player)
{
bool npcExists = NPC.AnyNPCs(mod.NPCType("Desertwormhead"));
if (npcExists)
{
framecount++;
if (framecount <= 60)
{
framecount = 0;
timer--;
if (timer <= 0)
{
NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("Bruhmouth"));
Main.PlaySound(SoundID.Roar, player.position, 0);
}
}
}
}