local globalevent = GlobalEvent("npc")
function globalevent.onTime(interval)
if math.random(10) == 1 then
Game.createNpc("NPC Name", Position(150, 150, 7), false, true)
end
return true
end
globalevent:time("22:00")
globalevent:register()
function onThink(interval)
if math.random(10) == 1 then
Game.createNpc("NPC Name", Position(150, 150, 7), false, true)
end
return true
end
Try this, written from memory
LUA:function onThink(interval) if math.random(10) == 1 then Game.createNpc("NPC Name", Position(150, 150, 7), false, true) end return true end
local pos = {x = 1774, y = 968, z = 7}
local npc = {"npc"}
function onTimer(interval)
local npc = npc[math.random(#bosses)]
doCreateNpc(npc, pos)
doBroadcastMessage(npc.." has spawned.", MESSAGE_STATUS_WARNING)
return true
end