dofile("scripts/entities/entityinclude.lua")

n = 0
done = false

function init(me)
	ent = node_getNearestEntity(me, "FinalDoor")
	n = getNaija()
end

function activate(me)
end

function update(me, dt)
	if not done then
		if node_isEntityIn(me, n) and not (entity_isState(ent, STATE_OPENED) or entity_isState(ent, STATE_OPEN)) then
			entity_setState(ent, STATE_OPEN, -1, 1)
			done = true
		end
	end
end
