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

Lua Verify how many enabled Addons a player have

grilo13

RAWR
Joined
Jun 17, 2011
Messages
254
Solutions
4
Reaction score
57
Location
HUEland
GitHub
mTsGrilo
Hey, I'd like to know if is safe to add something like that on login.lua (creaturescripts) to count how many enable addons (Addon 1 and 2) a player have:

Lua:
if(player:hasOutfit(128, 3) or player:hasOutfit(136, 3)) then
add this to a var
if(player:hasOutfit(129, 3) or player:hasOutfit(137, 3)) then
add this to a var

1st, I guess it won't count an addon if player gets it in "a quest" and don't logout/login
2nd, I don't know if I need to use that or to verify female outfits too

It's just an idea, I want to use addon bonuses by the count of addons a player have. Like:
1 addon = +10HP +10MP
2 addons = +1 shield
etc

Thanks in advance for any help :)
 
Hey, I'd like to know if is safe to add something like that on login.lua (creaturescripts) to count how many enable addons (Addon 1 and 2) a player have:

Lua:
if(player:hasOutfit(128, 3) or player:hasOutfit(136, 3)) then
add this to a var
if(player:hasOutfit(129, 3) or player:hasOutfit(137, 3)) then
add this to a var

1st, I guess it won't count an addon if player gets it in "a quest" and don't logout/login
2nd, I don't know if I need to use that or to verify female outfits too

It's just an idea, I want to use addon bonuses by the count of addons a player have. Like:
1 addon = +10HP +10MP
2 addons = +1 shield
etc

Thanks in advance for any help :)
1) You would have to update the bonuses when you add a new outfit, to do that you could change the addOutfit / addOutfitAddon doing something like that in global.lua:
Lua:
local playerAddOutfitAddon = Player.addOutfitAddon
function Player:addOutfitAddon(lookType, addon)
    playerAddOutfitAddon(self, lookType, addon)
    self:updateAddonBonuses()
end

Something similar for addOutfit (only if you plan to count outfits without addon too.)

2) You have to verify the sex and get the respective lookType to check. You really shouldn't do like you're doing.
 
Back
Top