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

Lua [TFS 0.X] Door with Storage

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,403
Solutions
17
Reaction score
151
Location
Brazil
Im trying to put a storage value in door to permit player to enter in quest, but got bugging.
1650404179642.png
XML
XML:
<action actionid="25125" event="script" value="azerusdoor.lua"/>

LUA
Lua:
function onUse(cid, item, frompos, item2, topos)

local storage = 6677 -- coloque o storage aqui


if getPlayerStorageValue(cid, storage) > 0 then
doCreatureSay(cid, "Calm donw man! Let's go.", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 22, "The door seems to be sealed against unwanted intruders.")
end

return true
end

I try to open with a player with storage, receive message "Calm donw man! Let's go." but door its not opening.
1650404213570.png
 
Solution
put like u said, but not works

View attachment 67173
View attachment 67174
Post automatically merged:

Solved with this thread:

it's because in the first image above you used a special door, and in the second photo you are using a questdoor, in the questdoors, it's the level you put, example actionid 1100, it means only level 100(1100-1000=100) or higher passes and in the specialsdoor, you put the storage as I mentioned.

if your intention is the ones I mentioned, level or storage that does not depend on a specific value (example: player only passes through the doors with storage 6677 and value 7), there is no need for new scripts, making even the creation of your server more easy...
check if script its a problem, i dont think so, probably player has not storage "6677" higher than 0.

Lua:
function onUse(cid, item, frompos, item2, topos)


print("Storage : " .. getPlayerStorageValue(cid, storage))
local storage = 6677 -- coloque o storage aqui





if getPlayerStorageValue(cid, storage) > 0 then

doCreatureSay(cid, "Calm donw man! Let's go.", TALKTYPE_ORANGE_1)

else

doPlayerSendTextMessage(cid, 22, "The door seems to be sealed against unwanted intruders.")

end



return true

end
 
check if script its a problem, i dont think so, probably player has not storage "6677" higher than 0.

Lua:
function onUse(cid, item, frompos, item2, topos)


print("Storage : " .. getPlayerStorageValue(cid, storage))
local storage = 6677 -- coloque o storage aqui





if getPlayerStorageValue(cid, storage) > 0 then

doCreatureSay(cid, "Calm donw man! Let's go.", TALKTYPE_ORANGE_1)

else

doPlayerSendTextMessage(cid, 22, "The door seems to be sealed against unwanted intruders.")

end



return true

end
Returning Storage : -1

I have changed on script to storage <=0, but still cant pass. but in DB the storage is 1.

1650405369360.png
 
Your script replaces normal doors script. So you must add there code that transforms closed doors into open doors.

If it's possible to walk thru players on your server, you will also have to add movement script that blocks walking thru open doors, when player with access stands in them.
 
Returning Storage : -1

I have changed on script to storage <=0, but still cant pass. but in DB the storage is 1.

View attachment 67166
if you want players who have storage 6677 with value 0 or higher to go through the port, simply add the storage 6677 to the port's actionid.
 
damn i make a print before "local" storage its registered, so this is why it returned -1, if database has 1 then its fine, anyway gesior explained, there is no func that closed doors transform into open door
 
if you want players who have storage 6677 with value 0 or higher to go through the port, simply add the storage 6677 to the port's actionid.
put like u said, but not works

1650451997544.png
1650452038557.png
Post automatically merged:

Solved with this thread:

 
Last edited:
put like u said, but not works

View attachment 67173
View attachment 67174
Post automatically merged:

Solved with this thread:

it's because in the first image above you used a special door, and in the second photo you are using a questdoor, in the questdoors, it's the level you put, example actionid 1100, it means only level 100(1100-1000=100) or higher passes and in the specialsdoor, you put the storage as I mentioned.

if your intention is the ones I mentioned, level or storage that does not depend on a specific value (example: player only passes through the doors with storage 6677 and value 7), there is no need for new scripts, making even the creation of your server more easy.

Just test, change gate of experience for specialdoor and write the storage.
 
Solution
it's because in the first image above you used a special door, and in the second photo you are using a questdoor, in the questdoors, it's the level you put, example actionid 1100, it means only level 100(1100-1000=100) or higher passes and in the specialsdoor, you put the storage as I mentioned.

if your intention is the ones I mentioned, level or storage that does not depend on a specific value (example: player only passes through the doors with storage 6677 and value 7), there is no need for new scripts, making even the creation of your server more easy.

Just test, change gate of experience for specialdoor and write the storage.
just like u said, thanks!
 
Back
Top