From 5263c474333f8afa7a6f264dd79e5bd175fcf4b0 Mon Sep 17 00:00:00 2001 From: Sorvani Date: Mon, 8 Jul 2013 00:13:08 -0700 Subject: [PATCH] just an example of access doors and changing their lockpick settings.would be similar to do keyitem --- Lua-Examples.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Lua-Examples.md b/Lua-Examples.md index 5007d36..5cbb186 100644 --- a/Lua-Examples.md +++ b/Lua-Examples.md @@ -57,6 +57,22 @@ end ``` ### Player +``` +-- player.lua example of access and changing the lockpick value of a door. +function event_click_door(e) + local DoorID = e.door:GetDoorID(); + local entity_list = eq.get_entity_list(); + e.self:Message(15,"You clicked on DoorID: "..DoorID); + local door = entity_list:FindDoor(DoorID); + e.self:Message(15,"GetLockPick was: "..door:GetLockPick()); + if (entity_list:FindDoor(DoorID):GetLockPick() == 0) then + door:SetLockPick(-1); + else + door:SetLockPick(0); + end + e.self:Message(15,"GetLockPick is now: "..door:GetLockPick()); +end +``` ### Item