Skip to content

Commit

Permalink
Update spawns_npc_by_time.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Feb 20, 2024
1 parent 4ad2a7a commit 7eff9fa
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ function spawnsNpcByTime.onPeriodChange(period)
local spawnNpc = Game.createNpc(npcSpawn.name, npcSpawn.position)
if spawnNpc then
spawnNpc:setMasterPos(npcSpawn.position)
npcSpawn.position:sendMagicEffect(CONST_ME_TELEPORT)
logger.info("[NPC Spawn] {} has spawned", npcSpawn.name)
spawnNpc:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
elseif npcSpawn.despawnPeriod == period then
local despawnNpc = Npc(npcSpawn.name)
if despawnNpc then
despawnNpc:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
despawnNpc:remove()
logger.info("[NPC Despawn] {} has despawned", npcSpawn.name)
end
end
end
Expand Down

0 comments on commit 7eff9fa

Please sign in to comment.