dennisek78
New Member
- Joined
- Aug 2, 2010
- Messages
- 14
- Reaction score
- 0
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
Do you Repair this script ??
Link to original post: http://otland.net/f81/open-secret-passage-52650/
Very please :<