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

TFS 1.X+ Door with storage to pass tfs 1.5

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
928
Solutions
7
Reaction score
127
Location
Brazil
YouTube
caruniawikibr
hello, I'm trying to make the player can enter through the door if he has the storage, if he doesn't have it warns that he doesn't have permission. But I can't get it to work, can anyone help?
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9999) ~= -1 then
doPlayerSendCancel(cid, "You don't have the necessary permission to enter.")
doSendMagicEffect(getPlayerPosition(cid))
return true
end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition)
return true
end
 
Solution
hello, I'm trying to make the player can enter through the door if he has the storage, if he doesn't have it warns that he doesn't have permission. But I can't get it to work, can anyone help?
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9999) ~= -1 then
doPlayerSendCancel(cid, "You don't have the necessary permission to enter.")
doSendMagicEffect(getPlayerPosition(cid))
return true
end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition)
return true
end

if you want the player to go through the door having storage value 1 or higher, just add the storage ID in the actionid of the door(red handgrip), example: 45000, if the player has value 1 or 1000...
hello, I'm trying to make the player can enter through the door if he has the storage, if he doesn't have it warns that he doesn't have permission. But I can't get it to work, can anyone help?
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 9999) ~= -1 then
doPlayerSendCancel(cid, "You don't have the necessary permission to enter.")
doSendMagicEffect(getPlayerPosition(cid))
return true
end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition)
return true
end

if you want the player to go through the door having storage value 1 or higher, just add the storage ID in the actionid of the door(red handgrip), example: 45000, if the player has value 1 or 1000 it doesn't matter, he can go through the door because he holds the storageID 45000.

Now if you want the player to have a specific storage, for example: storageID 45000, value 7, you will need to make a separate script like this:

You need to change the door id where is 5114 to what door youre using, and register this with a actionid or uniqueid on map and actions.xml

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(STORAGE ID) == ESPECIFIC VALUE then
        if item.itemid == 5114 then
            player:teleportTo(toPosition, true)
            item:transform(item.itemid + 1)
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
    end
    return true
end

XML:
<action actionid="AID NUMBER ON MAP AND HERE" script="SCRIPT NAME.lua" />

remember only to use this script if you want a specific STORAGE VALUE to pass, if not, just add the storageID in the door in mapeditor
 
Last edited:
Solution
Back
Top