• 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+ storage to outfit tfs 1.5 7.72

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
882
Solutions
7
Reaction score
123
Location
Brazil
YouTube
caruniawikibr
<outfit type="1" looktype="308" name="Wyzard" premium="yes" unlocked="yes" enabled="yes" />
Hi, can anyone clear this doubt for me? How do I set storage for clothes? I wish a player could only get after a task for example and not be free for everyone to use
 
Solution
If you want them to unlock the outfit...

change to
Lua:
unlocked="no"
Which will disable the outfit, until you give it to them.

To check if they have unlocked the outfit
Lua:
if not player:hasOutfit(308) then
    print("Player does not own the outfit.")
    return
end

After you've confirmed they own the outfit, then you can check for addons.
Lua:
if not player:hasOutfit(308, 1) -- addon 1 then
    print("Player does not own addon 1.")
    return
end
Lua:
if not player:hasOutfit(308, 2) -- addon 2 then
    print("Player does not own addon 2.")
    return
end
Lua:
if not player:hasOutfit(308, 3) -- addon 1 & 2 then
    print("Player does not own both of the addons.")
    return
end

and of course, to give them the outfit and...
If you want them to unlock the outfit...

change to
Lua:
unlocked="no"
Which will disable the outfit, until you give it to them.

To check if they have unlocked the outfit
Lua:
if not player:hasOutfit(308) then
    print("Player does not own the outfit.")
    return
end

After you've confirmed they own the outfit, then you can check for addons.
Lua:
if not player:hasOutfit(308, 1) -- addon 1 then
    print("Player does not own addon 1.")
    return
end
Lua:
if not player:hasOutfit(308, 2) -- addon 2 then
    print("Player does not own addon 2.")
    return
end
Lua:
if not player:hasOutfit(308, 3) -- addon 1 & 2 then
    print("Player does not own both of the addons.")
    return
end

and of course, to give them the outfit and addons
Lua:
player:addOutfit(308)
Lua:
-- NOTE: Giving addons will also give the outfit, if they do not already own it.
player:addOutfitAddon(308, 1) -- give only addon 1
player:addOutfitAddon(308, 2) -- give only addon 2
player:addOutfitAddon(308, 3) -- give addon 1 & 2
 
Solution
You can use this on item
Lua:
local config = {
    storage = 535923,
    effect = 4,
    text1 = "You have gained your new outfit!",
    text2 = "You already have this outfit!",
    looktype = 267
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(config.storage) < 1 then
        player:addOutfit(config.looktype)
        player:sendTextMessage(MESSAGE_INFO_DESCR, config.text1)
        player:setStorageValue(config.storage, 1)
        player:getPosition():sendMagicEffect(config.effect)
        item:remove()
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, config.text2)
    end
    return true
end

Or with quest : [TFS 1.3] Advanced quest chests (https://otland.net/threads/tfs-1-3-advanced-quest-chests.277772/)
 
in case I want to add to a mission of an npc for example, there he will give a storage, this storage is not in the xml outfit? example?

<outfit type="0" looktype="309" name="Wyzard" storageId="61123" storageValue="1" premium="yes" unlocked="no" enabled="yes " />
 
Back
Top