Code: Select all
function TorchPuzzle1()
if t1.socket:getItem() and t2.socket:getItem() then
dungeon_secret_door_10.door:open()
else
dungeon_secret_door_10.door:close()
end
end
Code: Select all
function TorchPuzzle1()
if t1.socket:getItem() and t2.socket:getItem() then
dungeon_secret_door_10.door:open()
else
dungeon_secret_door_10.door:close()
end
end
If you want create a multiply condition you can use only 'and'. The second 'if' is not required. btw if you want negative you condition write 'not' for example:Mysterious wrote:Ok I have 2 torch holders named t1 and t2. The first to Scripts work, but the 3rd Script does not. Does anyone know how to fix this I have tried for 3 hours lol.
function TorchPuzzle1()
if t1.controller:getHasTorch() == true and
if t2.controller:getHasTorch() == true then ---Error is here---
Code: Select all
if t1.controller:getHasTorch() == true and not
t2.controller:getHasTorch() == true then
Code: Select all
if not counter1.counter:getValue() == 5 and
t2.controller:getHasTorch() == true then
bla bla bla bla
Code: Select all
function torchpuz1a()
if not counter1.counter:getValue() == 5 and
t2.controller:getHasTorch() == true then
dungeon_door_wooden_11.door:open()
end
end
Code: Select all
torchCounter = 0
function DoItFiveTimes()
torchCounter = torchCounter + 1
if torchCounter >= 5 then ourDoor.door:open() end
end