• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent Set Passwords to Doors

That doesn't matter, you can add it anywhere after the password is correct.


Like this?

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Your password "'..newText..'" is correct, you can now enter.') doTeleportThing(cid, x.doorpos) addEvent(onCloseDoor,x.doorclosetime*1000)
 
You could set player storage after correct password and put a tile there to check storage to keep players out :p
 
@Limos Make it possible to change its password randomly With remove items ? to add it on Quests
 
Will try it for 1.0, good job Limos.

Kind Regards,
Eldin.
 
I set everything up correctly, and it does nothing for me. I also get no error in the console any idea?
 
Which server do you use, are the ids and positions correct, did you register it in login.lua?
 
I use realserver 3.3 (8.6)
I registered it in login.lua and the blackboard uni id is set correctly and action id on the door is 101,
the positions are correct as well.
 
I implemented this systems and it works for the first person who writes the password, but it doesn't work for anyone else, why is this?
 
What happens after you used it once? What exactly is different than the first time you set the password?
Do you get errors and which server do you use?
 
Last edited:
When another person tries to write the password, clicking on the blackboard, it shows: "You cannot use this object."
I'm using TFS 0.3.6
 
Do you get errors and what changed, what do you see when you click look op the blackboard?
 
CharacterA)

I get to the door, next to it is the blackboard, I look the blackboard and says:
"You see a blackboard
Nothing is written on it."

Then I right-click the blackboard, a textbox opens and there I write the password, the doors opens and I can pass trough the door, then, after 3 seconds, the door closses.

After 10~ seconds I get to the door with characterB...

CharacterB)

I look the Blackboard and says:
"You see a blackboard
Nothing is written on it."

Then I right-click the blackboard, no textbox opens.
The door is locked.

No error shows in console.
 
I mean when you click look with your god character, to see all the ids.
 
And this is my script:

Code:
-- Passwords to doors by Limos
local uniqueids = {8050, 8051}

local passwords = {
["immortalis"] = {doorpos = {x = 953, y = 1016, z = 7}, doorid = 9165, blackboardpos = {x = 953, y = 1017, z = 7}, blackboardid = 1815, uniqueid = 8050, doorclosetime = 3},
["stars"] = {doorpos = {x = 1000, y = 1000, z = 7}, doorid = 1213, blackboardpos = {x = 1000, y = 1000, z = 7}, blackboardid = 1811, uniqueid = 8051, doorclosetime = 3}
}

function onTextEdit(cid, item, newText)

local x = passwords[newText]

local function onCloseDoor()
if(getTileItemById(x.doorpos,x.doorid+1).uid) > 0 then
doTransformItem(getTileItemById(x.doorpos,x.doorid+1).uid, x.doorid)
doSendMagicEffect(x.doorpos, CONST_ME_MAGIC_RED)
end
end

for _, check in pairs(uniqueids) do
if item.uid == check then
if x and item.uid == x.uniqueid then
if(getTileItemById(x.doorpos,x.doorid).uid) > 0 then
doTransformItem(getTileItemById(x.doorpos,x.doorid).uid, x.doorid + 1)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'La contrasena ingresada "'..newText..'" es correcta, tienes 3 segundos para ingresar.')
addEvent(onCloseDoor,x.doorclosetime*1000)
doTeleportThing(cid, x.doorpos)
doRemoveItem(item.uid, 1)
local blackboard = doCreateItem(x.blackboardid,1,x.blackboardpos)
doItemSetAttribute(blackboard, "uid", x.uniqueid)
else
doRemoveItem(item.uid, 1)
local blackboard = doCreateItem(x.blackboardid,1,x.blackboardpos)
doItemSetAttribute(blackboard, "uid", x.uniqueid)
doPlayerSendCancel(cid, 'La puerta se encuentra abierta, ingresa rapido o espera a que se cierre.')
end
else
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, 'La contrasena ingresada "'..newText..'" es incorrecta.')
end
end
end
return true
end
 
Back
Top