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

[request] Door cant open if a player have storage "xxx"

Esparda

Member
Joined
Jun 9, 2008
Messages
188
Reaction score
9
Greetings..

I need some help with this request, I Hope someone can help with a script my idea is when a player do a quest he cant pass again the door of that quest, thnak you for you help guys.. sorry my bad english
 
You'll only need a movements script, to make this work properly.
If I was doing it for myself, I'd probably make the door transform to closed when someone walks away from the entrance of it, but you can add that in yourself, as that was not part of the original request.

If I understand correctly, anyone can pass through this door, until they have completed the quest, then they can no longer pass through the door.

Place AID underneath door (on the Floor tile) in map editor.
Added prints to console for troubleshooting, and some text in-game for flavour.

data/movements/movements.xml
Code:
<movevent type="StepIn" actionid="45001" event="script" value="script_name.lua"/>
data/movements/scripts/script_name.lua
Code:
local storage = 45001

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then
        return true
    end
    print("")
    print("Player Found!")
    if getPlayerStorageValue(cid, storage) == 1 then
        print("Player has already completed quest! Player access Removed.")
        doCreatureSay(cid, "Argh! " .. getCreatureName(cid) .. ", you heathen.. Begone!.", TALKTYPE_ORANGE_1)
        doTeleportThing(cid, fromPosition, true)
        return true
    end
    print("Player has not completed quest! Player allowed Access.")
    doCreatureSay(cid, "Welcome, " .. getCreatureName(cid) .. ".", TALKTYPE_ORANGE_1)
    return true
end
 
for quest door
Code:
local storage = 0000
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, storage) == 1 then
        doPlayerSendTextMessagel(cid, MESSAGE_STATUS_SMALL, 'You have already completed this quest.)
        return false
    end
    return true
end

Code:
<action itemid="door id" script="script.lua"/>
 
Back
Top