local function removeNpc(name)
local guy = Npc(name)
-- Check if we found a valid NPC
if guy and guy:isNpc() then
-- Bye bye
guy:remove()
end
end
-- Create NPC
local cipfried = Game.createNpc("Cipfried", Position(100, 100, 7))
-- Remove NPC after 5 minutes
addEvent(removeNpc, 5 * 60 * 1000, cipfried:getName())