Okay, I'm a bit stumped. Here's the scenario.
I created a custom potion similar to the potion of umbral solution in ORR 2. This potion, when put into an alcove opens the door next to the alcove. It's called potionunlocking.
I don't want the potion to be a forever use thing where after it's put into the alcove the champion can just remove it and use it over and over. So I want it destroyed when it's put into the altar but after the door is opened.
I've tried everything I can think of but every name I try to reference I come up with a nil value.
Here is what I have right now. Obviously, it's wrong.
Code: Select all
function checkAlcoveForItems()
-- change these variables to match your alcove's ID and the item you want to test for
local itemName1 = "potionunlocking"
local alcoveID1 = temple_alcove_10
counter = 0
-- iterate through all the contained items on alcove, checking for a matching name
for i in alcoveID1:containedItems() do
if i.name == itemName1 then
itemFound1()
end
end
end
-- run this script _once for each item_ with a matching name
function itemFound1()
counter = counter+1
if counter == 1 then
temple_door_metal_2:open();
potionunlocking:destroy()
end
end
I've tried i.name, itemName, alcoveID1:containedItems() , nothing works.
I'll try to see if I can find the code in ORR 2 but that's like looking for a needle in a haystack.