• 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!

quest door

bybbzan

mapper
Joined
Aug 4, 2012
Messages
809
Solutions
2
Reaction score
136
Location
Sweden
Hello!

I've searched for a script to my quest door.
It's pretty sad i can't make it myself cuz it's so simple.
I just want a script that allows me to go through the door if i'm level X.

Sk_rmklipp.png


Thanks in advance.
 
Not sure what version you are using, etc.

This door (in the pic) is specific to quests. If you set the ID on the door to the same as a storage value, they can only open it if they did the quest, see?

What you're looking for is a gate of expertise. (press j in map editor type "gate of")

After that, you just set the action id to 1000+ whatever level they have to be to get in. So level 50 would be action id 1050.

Read this (and find more stuff like it to read). https://otland.net/threads/how-to-doors.138592/
 
Not sure what version you are using, etc.

This door (in the pic) is specific to quests. If you set the ID on the door to the same as a storage value, they can only open it if they did the quest, see?

What you're looking for is a gate of expertise. (press j in map editor type "gate of")

After that, you just set the action id to 1000+ whatever level they have to be to get in. So level 50 would be action id 1050.

Read this (and find more stuff like it to read). https://otland.net/threads/how-to-doors.138592/

Yea i know the gate of expertise would be a great option, but i really want to use that door in the picture instead.
 
Then this belongs in the requests section.

You need a script that sets a storage when they get level 50. (on advance)
And then one that removes the storage when they lose level 50-> 49.
That door will need the actionid of the storage from the script.

You might be able to poke around your server and copy an existing script. Either way, this is a "request".
 
Then this belongs in the requests section.

You need a script that sets a storage when they get level 50. (on advance)
And then one that removes the storage when they lose level 50-> 49.
That door will need the actionid of the storage from the script.

You might be able to poke around your server and copy an existing script. Either way, this is a "request".
Okay, thanks for your help,
 
Then this belongs in the requests section.

You need a script that sets a storage when they get level 50. (on advance)
And then one that removes the storage when they lose level 50-> 49.
That door will need the actionid of the storage from the script.

You might be able to poke around your server and copy an existing script. Either way, this is a "request".
no?

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if (player:getLevel() >= 50) then
        return item:transform(item:getId() == xxxxx and xxxxx+1 or xxxxx)
    end
    return true
end

replace xxxxx with the closed door id
 
no?

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if (player:getLevel() >= 50) then
        return item:transform(item:getId() == xxxxx and xxxxx+1 or xxxxx)
    end
    return true
end

replace xxxxx with the closed door id

I forgot to say that im using a 7.6 server, so this script doesnt work properly.
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/quests/door.lua:onUse

data/actions/scripts/quests/door.lua:2: attempt to index local 'player' (a number value)
stack traceback:
        data/actions/scripts/quests/door.lua:2: in function <data/actions/scripts/quests/door.lua:1>
 
thats why you read the board rules

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (getPlayerLevel(cid) >= 50) then
        return doTransformItem(item.uid, item.itemid == xxxxx and yyyyy or xxxxx)
    end
    return true
end
xxxxx = closed door
yyyyy = open door
 
thats why you read the board rules

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (getPlayerLevel(cid) >= 50) then
        return doTransformItem(item.uid, item.itemid == xxxxx and yyyyy or xxxxx)
    end
    return true
end
xxxxx = closed door
yyyyy = open door
Thank you very much.
 
thats why you read the board rules

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (getPlayerLevel(cid) >= 50) then
        return doTransformItem(item.uid, item.itemid == xxxxx and yyyyy or xxxxx)
    end
    return true
end
xxxxx = closed door
yyyyy = open door
What's with the extra parentheses?
Seems like a weird habit you picked up, and should get rid of.

o/
 
Back
Top