Combination Lock Script error
Posted: Tue Dec 18, 2012 4:14 am
Anyone with Script experience who can give me pointers would be a big help.
I created the follow combination lock script using pressure plates:
This is tied to a counter with an initial value of 7. The combination lock works, but throws a script error the next time the party steps on any of the plates. Is there a way to script around this?
Can the pressure plates be disabled or de-spawned once the combination is complete?
The only other way around this that I can think of would be to use objects to activte the combination rather than the party.
I created the follow combination lock script using pressure plates:
Code: Select all
function sequenceRiddle()
local triggerEntity = "northern_dungeon_pressure_plate"
local namingPattern = "sequenceLock_"
local sequenceOfThings = {"1","3","2","4","1","3","2"}
local sequenceCounterID = "SequenceCounter"
local curSeq = #sequenceOfThings+1-findEntity(sequenceCounterID):getValue()
for i in entitiesAt(party.level, party.x, party.y) do
if i.name == triggerEntity then
if i.id == namingPattern..sequenceOfThings[curSeq] then
findEntity(sequenceCounterID):decrement()
else
findEntity(sequenceCounterID):reset()
end
end
end
end
Can the pressure plates be disabled or de-spawned once the combination is complete?
The only other way around this that I can think of would be to use objects to activte the combination rather than the party.