• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Return gate to normal

Rastemiun

New Member
Joined
Oct 2, 2012
Messages
3
Reaction score
0
Hello otland, i are new player in otland, i need 1 script.

i have one script that it puts password to a door, and put it right, the door disappears, I just want to edit it and put the door appears in the same position,

This is the script


-- Passwords to doors by Limos
local uniqueids = {8049, 8050}

local passwords = {
["demon vs angel"] = {doorpos = {x = 645, y = 1049, z = 8}, doorid = 6261, blackboardpos = {x = 644, y = 1049, z = 8}, blackboardid = 1811, uniqueid = 8049, doorclosetime = 10},
["stars"] = {doorpos = {x = 1000, y = 1000, z = 7}, doorid = 1213, blackboardpos = {x = 1000, y = 1000, z = 7}, blackboardid = 1811, uniqueid = 8050, doorclosetime = 10}
}

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, 'Your password "'..newText..'" is correct, you can now enter.')
addEvent(onCloseDoor,x.doorclosetime*1000)
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, 'The door is already open, be quick or wait till it is closed.')
end
else
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, 'Your password "'..newText..'" is not correct.')
end
end
end
return true
end

<event type="textedit" name="Password" event="script" value="passdoors.lua"/>

Please help
 
Back
Top