JDB
OtLand Veteran
- Joined
- Jun 1, 2009
- Messages
- 4,145
- Solutions
- 2
- Reaction score
- 115
The Forgotten Server 0.3.5
It is pretty obvious what it does.
Say !pass "words" and it removes a door or w/e, for XX seconds.
data/talkactions/talkactions.xml
data/talkactions/scripts/script.lua
Extra Feature:
It is pretty obvious what it does.
Say !pass "words" and it removes a door or w/e, for XX seconds.
data/talkactions/talkactions.xml
PHP:
<talkaction log="no" words="!pass" access="0" event="script" value="script.lua"/>
data/talkactions/scripts/script.lua
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
Extra Feature:
- Countdown at passage position. [10, 9, 8, 7, 6...]
Last edited: