function spawnResource(ship) local loc = ship:getLoc() resourceitem = ResourceItem.new() --"setup" for creating a new resource item resourceitem:setLoc(loc) levelgen:addItem(resourceitem) end function removeSpecificObject() object = levelgen:findObjectById(5) if(object ~= nil) then object:removeFromGame() else return end end function onShipEnteredZone(ship, zone, zoneType, zoneId) if(zoneId == 2) then --I was too lazy to change all the zones to zoneID 1. DEAL WITH IT. spawnResource(ship) end end function onTick() end function main() subscribe(Event.ShipEnteredZone) Timer:scheduleOnce(removeSpecificObject, 120000) end