The idea is to open a door by placing a water_flask on an altar (altar_2). I got that to work. But now for the sake of consistency, have been trying to make the door close as soon as player removes the water_flask from the altar. I think I need a second if/then statement to make the altar check after activating the door once. Anyway, can anyone explain why this if/then/else isn't working the way I think it should? Thanks.
Code: Select all
function WaterOffering()
for i in altar_2:containedItems() do
if i.name == "water_flask" then
waterLocked_door:open()
else
waterLocked_door:close()
end
end
end