• 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+ addoutfit error

LoOoZa

Member
Joined
Sep 18, 2017
Messages
68
Reaction score
6
how to add new outfit in tfs 1.3
im use this script and not give me outfit.

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    if player:getStorageValue(8578885) == 1 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already have this outfit.')
    else
    player:setStorageValue(8578885, 1)
    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Congratulations, You have new outfit.')
    player:addOutfit(302)
end
end
 
Replace

Lua:
player:addOutfit(302)

with

Lua:
player:addOutfitAddon(302)


Also as far as I know you can't set a storagevalue higher than 64 or 65k I don't remember exactly
 
Last edited:
no one understand me so i will give photo from this, need add new outfit ID 302
1599760122881.png
I mean this outfit ID 302 and i do this in actions /
Lua:
player:addOutfit(302)
and not give me this outfit in select outfit!!
 
if the player has not access id, the outfit wont show up, you may need to change (or remove) the access id on outfits.xml in order for everyone to use the outfit.

or you can set the storagevalue in outfits.xml but im not sure if you need to change the access id either...

just add ..... storageId = "8578885" storageValue = "1" .... so everyone that has the storage can use the outfit, your script wont need the player:addOutfit line

here's something about this:

 
Last edited:
it's already set by default, he just need to change either the access id and/or add the storageValue

But he wants that you can't select the outfit. if you add it to outfits.xml you'll be able to change/wear it everytime, with player:setOutfit you'll receive the looktype only without showing it in set outfit if i'm not mistaken :)
 
if he is setting a storagevalue on the script only the people with the storage value can wear the outfit, and it will show olny for the people that have the storagevalue,.... needs to be set on outfits.xml as I said earlier

if he wants to set the outfit only with onUse function (without storage) he needs to check the functions_lua and look for something like this:

Lua:
creature:setOutfit

since i dont use tfs 1.x i dont know exactly the fucntion but it should be something in between...

Lua:
creature:setOutfit({lookType = 302})

i need to add as @Loney said: " Also as far as I know you can't set a storagevalue higher than 64 or 65k I don't remember exactly "
i would just write a more simple storageValue like
Lua:
 if player:getStorageValue(1111) == 1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already have this outfit.')
    else
    player:setStorageValue(1111, 1)

- ....
- ....
- ....
 
Last edited:
But he wants that you can't select the outfit. if you add it to outfits.xml you'll be able to change/wear it everytime, with player:setOutfit you'll receive the looktype only without showing it in set outfit if i'm not mistaken :)

Exactly, I think that just setting the outfit tag in outfits.xml will solve the problem. And the scripts above can be used.

Lua:
<-- Male Example -->
    <outfit type="1" looktype="302" name="Manager" premium="no" unlocked="no" enabled="yes" />
 
Exactly, I think that just setting the outfit tag in outfits.xml will solve the problem. And the scripts above can be used.

Lua:
<-- Male Example -->
    <outfit type="1" looktype="302" name="Manager" premium="no" unlocked="no" enabled="yes" />
but if me do that all players will use it, only want players with storage value use it
Post automatically merged:

if he is setting a storagevalue on the script only the people with the storage value can wear the outfit, and it will show olny for the people that have the storagevalue,.... needs to be set on outfits.xml as I said earlier

if he wants to set the outfit only with onUse function (without storage) he needs to check the functions_lua and look for something like this:

Lua:
creature:setOutfit

since i dont use tfs 1.x i dont know exactly the fucntion but it should be something in between...

Lua:
creature:setOutfit({lookType = 302})

i need to add as @Loney said: " Also as far as I know you can't set a storagevalue higher than 64 or 65k I don't remember exactly "
i would just write a more simple storageValue like
Lua:
 if player:getStorageValue(1111) == 1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already have this outfit.')
    else
    player:setStorageValue(1111, 1)

- ....
- ....
- ....
this do change outfit to 302 but not add it.
 
XML:
<outfit type="1" looktype="302" name="Manager" premium="no" unlocked="no" enabled="yes" storageId="8578885" storageValue="1"/>

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    if player:getStorageValue(8578885) == 1 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already have this outfit.')
    else
    player:setStorageValue(8578885, 1)
    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Congratulations, You have new outfit.')
end
end

you just need that :cool:

you may need to change the "unlocked" to "yes" on your xml, if you have problems please post your full outfits.xml
 
XML:
<outfit type="1" looktype="302" name="Manager" premium="no" unlocked="no" enabled="yes" storageId="8578885" storageValue="1"/>

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    if player:getStorageValue(8578885) == 1 then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You already have this outfit.')
    else
    player:setStorageValue(8578885, 1)
    player:sendTextMessage(MESSAGE_INFO_DESCR, 'Congratulations, You have new outfit.')
end
end

you just need that :cool:

you may need to change the "unlocked" to "yes" on your xml, if you have problems please post your full outfits.xml
still not showing in outfit select
 
Back
Top