TFS 1.X+ storage to outfit tfs 1.5 7.72

bpm91

Premium User
Premium User
Joined
May 23, 2019
Messages
342
Solutions
5
Reaction score
26
<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...

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
6,036
Solutions
493
Reaction score
4,207
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

dewral

Intermediate OT User
Joined
Dec 4, 2019
Messages
211
Solutions
9
Reaction score
108
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/)
 
OP
OP
bpm91

bpm91

Premium User
Premium User
Joined
May 23, 2019
Messages
342
Solutions
5
Reaction score
26
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 " />
 
Top