I hope this question has not been asked before, but I couldn't find something similar in the forum.
I want to write a skript, that executes the following puzzle:
There is a dungeon room with a door and three alcoves. Three gems have to be placed in the right alcove according to a puzzle in order to open the door.
The editor tutorial shows nicely, how you can do something like this with just one item, but I'm having trouble doing it with more than one.
My skript looks like this, but it can't be right like this:
Code: Select all
function newPuzzle()
-- iterate through all contained items on alcoves, checking for a matching name
for i in alcove1:containedItems() do
for j in alcove2:containedItems() do
for k in alcove3:containedItems() do
if i.name == "blue_gem" &
j.name == "red_gem" &
k.name == "green_gem" then
puzzleDoor:open()
break
end
end
end
end
end