I found this script and i've been trying to work on it to make it for 8.54 but I ran into some trouble.. please help!
Lua:
local standPos = {x=100, y=100, z=7} -- Player Stands Here
local bookCasePos = {x=100, y=100, z=7} -- Bookcase Spot
local passageKey = "Open Sesame" -- Message player has to say
local openTime = 10 -- Seconds the passage will remain open
local passageID = XXXX -- Passage Door/Blocking Item ID
local function countDown(n)
if(n > 0) then
doSendAnimatedText(bookCasePos, n, TEXTCOLOR_RED)
addEvent(countDown, 1000, n - 1)
else
local bookCase = getTileItemById(bookCasePos, passageID)
if(bookCase.uid == 0) then
doCreateItem(bookCasePos, passageID)
end
end
end
function onSay(cid, words, param)
if(#param == 0) then
doPlayerSendCancel(cid, "Command requires param.")
return true
end
if(param:lower() == passageKey:lower()) then
if(comparePos(getCreaturePosition(cid), standPos)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Passage has been revealed!")
local passageWay = getTileItemById(bookCasePos, passageID)
if(passageWay.uid ~= 0) then
doRemoveItem(passageWay.uid)
end
countDown(openTime)
else
doPlayerSendCancel(cid, "You must stand on the correct spot.")
end
else
doPlayerSendCancel(cid, "You must say the correct password to open the passage.")
end
return true
end