plekstw Posted December 12, 2015 Share Posted December 12, 2015 hey guys i have got a problem, i want to open doors to get to an npc but my script opens only 1 door please help http://pastebin.com/JzkNzuaV Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted December 12, 2015 Share Posted December 12, 2015 (edited) Right now you always get the closest door (open or closed), so if you open one the next time closest will still return the same door. Instead you could use a filter: objects.closest("Door", o -> o.hasAction("Open")) << this will always give you a closed door.You could do something like if knight is not null { if doorHandler.handleNextObstacle(knight) return // door handled, loop after else do pickpocket stuff}Doorhandler API Edited December 12, 2015 by Flamezzz 1 Quote Link to comment Share on other sites More sharing options...
plekstw Posted December 13, 2015 Author Share Posted December 13, 2015 Right now you always get the closest door (open or closed), so if you open one the next time closest will still return the same door. Instead you could use a filter: objects.closest("Door", o -> o.hasAction("Open")) << this will always give you a closed door. You could do something like if knight is not null { if doorHandler.handleNextObstacle(knight) return // door handled, loop after else do pickpocket stuff } Doorhandler API Thanks man! Worked wonderfull Quote Link to comment Share on other sites More sharing options...