how can i open a door with placing 3 items in 3 alcove?
I want to re create the scroll riddle with alcove, like in the level 4 or 5 (dont remenber) in LOG but I dont know how to do!
ex: in alcove (gha1) contain item "sr1" and gha2 contain "sr2" and gha3 contain "sr3"
tdmine:open
else
nothing
I have tried to modify the code but I dont know how to do!
I got this code:
only for 1 alcove and 1 item:
I have try with this one:
"sr1" is a item (scroll) renamed in the editor, placed somewhere and which contain a part of the riddle, but the door wont open, with "sr1", it seems that the script didnt consider the scroll id, and opens only if I let "scroll" instead of "sr1"
You can put any scroll to open the door, which is not what I want.
gha1 is the alcove name
tdmine is the door to open
can someone help me please?
Code: Select all
function check()
local valid = {"sr1"}
local counter = 0
for i in gha1:containedItems() do
local ok = false
for j = 1,#valid do
if i.name == valid[j] then
counter = counter + 1
ok = true
break
end
end
if not ok then
counter = -1
break
end
end
-- print(counter)
if counter == 1 then
tdmine:open()
end
end