-- Necromancer Abilities for the "Classes" Plugin local Necromancer = {} -- Summon an undead minion (zombie) function Necromancer.SummonUndead(Player) local World = Player:GetWorld() local Pos = Player:GetPosition() -- Debug: Print the spawn position print("Attempting to summon zombie at X=" .. Pos.x .. ", Y=" .. Pos.y .. ", Z=" .. Pos.z) -- Calculate chunk coordinates local ChunkX = math.floor(Pos.x / 16) local ChunkZ = math.floor(Pos.z / 16) -- Ensure the chunk is loaded before spawning the mob World:ChunkStay({{ChunkX, ChunkZ}}, nil, function() -- Attempt to spawn the zombie (ID: 36 for zombies) local Entity = World:SpawnMob(Pos.x, Pos.y, Pos.z, 36, true) if Entity then Player:SendMessage("§aYou have summoned an undead minion!") print("Zombie summoned successfully for player: " .. Player:GetName()) else Player:SendMessage("§cFailed to summon an undead minion. Check spawn conditions!") print("Failed to summon zombie for player: " .. Player:GetName()) end end) end -- Register necromancer-specific commands function Necromancer.RegisterCommands() -- Bind the /necromancer command cPluginManager:BindCommand("/necromancer", "", function(Split, Player) if #Split >= 3 and Split[2] == "summon" and Split[3] == "undead" then Necromancer.SummonUndead(Player) return true end Player:SendMessage("§cUsage: /necromancer summon undead") return true end, "§6Use Necromancer abilities: /necromancer ") end return Necromancer