• Vote in May Mapping Competition to select a winner!
  • 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+ Tfs 1.3 Have some function to check how many and how are players outfits?

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
919
Best answers
23
Reaction score
114
How can i check all player outfit, and how much outfits he have?
tfs 1.3 8.6
tried something like this, but player:hasOutfit() dont is a table.
Need to check if all outfits player have
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print(#player:hasOutfit())
    return true
end
 

Nekiro

Excellent OT User
TFS Developer
Support Team
Joined
Sep 7, 2015
Messages
2,104
Best answers
93
Reaction score
932
Write all looktypes to table and iterate checking one by one
 
OP
R

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
919
Best answers
23
Reaction score
114
My server the players start only with the initial outfit, to acquire new outfits he must go doing the quests.
so I needed to check if he has any outfit to click on set outfit.

for example, if he clicks on set outfit, and does not have quest I, he will take 'debug', because he will only have outfits on display after he does the quest.
all outfits will be unlocked="yes", because all outfits player will get in quests.

so i need something like:
onChangeOutfit:
Lua:
if #getOutfits() == 0 then
    return false
end
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<outfits>
    <!-- Female outfits -->
    <outfit type="0" looktype="136" name="Quest I" premium="no" unlocked="yes" enabled="yes" />
    
    <!-- Male outfits -->
    <outfit type="1" looktype="128" name="Quest I" premium="no" unlocked="yes" enabled="yes" />
</outfits>
 
Top