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

Remove Storage TFS 1.5 downgrade 8.6

Azerty

Active Member
Joined
Apr 15, 2022
Messages
335
Solutions
4
Reaction score
36
Good morning, I put this line to remove the storage when the player goes through the portal, but when the player resets(ctrl+g) the storage it comes back. Can someone help me?

Lua:
db.query(string.format("DELETE FROM `player_storage` WHERE `key` = 123456;"))
 
Solution
How?
Lua:
    local destination4 = Position(33221, 31923, 7)
    if isInArray({9715}, item.actionid) and player:getStorageValue(6395643) == 1 then
        player:teleportTo(destination4)
        destination4:sendMagicEffect(CONST_ME_FIREAREA)
        db.query(string.format("DELETE FROM `player_storage` WHERE `key` = 6395643;"))
replace db.query(string.format("DELETE FROM player_storage WHERE key = 6395643;")) with player:setStorageValue(6395643, -1)
If you want to see the changes reflected in the database you might want to try using player:save()
Try
Lua:
player:setStorageValue(storageId, value)
How?
Lua:
    local destination4 = Position(33221, 31923, 7)
    if isInArray({9715}, item.actionid) and player:getStorageValue(6395643) == 1 then
        player:teleportTo(destination4)
        destination4:sendMagicEffect(CONST_ME_FIREAREA)
        db.query(string.format("DELETE FROM `player_storage` WHERE `key` = 6395643;"))
 
Set the storage to value -1 when going through portal.
By reset you mean relog? If so then make an onLogin script to set another value.
 
How?
Lua:
    local destination4 = Position(33221, 31923, 7)
    if isInArray({9715}, item.actionid) and player:getStorageValue(6395643) == 1 then
        player:teleportTo(destination4)
        destination4:sendMagicEffect(CONST_ME_FIREAREA)
        db.query(string.format("DELETE FROM `player_storage` WHERE `key` = 6395643;"))
replace db.query(string.format("DELETE FROM player_storage WHERE key = 6395643;")) with player:setStorageValue(6395643, -1)
If you want to see the changes reflected in the database you might want to try using player:save()
 
Solution
If you want to see the changes reflected in the database you might want to try using player:save()

replace db.query(string.format("DELETE FROM player_storage WHERE key = 6395643;")) with player:setStorageValue(6395643, -1)
i tried it this way but the script is recognizing as the player is with a storage value of 1
 
i tried it this way but the script is recognizing as the player is with a storage value of 1
no matter what value you have stored, if you set it to -1 this value will be removed and not saved to the database when the player is saved.
 
Back
Top