Svira
Active Member
- Joined
- Jan 27, 2008
- Messages
- 263
- Solutions
- 11
- Reaction score
- 35
Hello, as in the topic. The problem is that the bonuses added with the outfit appear after the relogin, not the change of outfit itself.
my login.lua:
Engine TFS 1.3
I'm using the code: Outfit bonus 1.2
##EDIT
The script below allows you to load bonuses immediately, the item will change the outfit, but it does not delete the previous ones (those from the previous outfit)
my login.lua:
Lua:
-- Outfit bonus
if player:hasOutfit(player:getOutfit().lookType, 3) then
local bonusCondition = getBonusCondition(player:getOutfit().lookType)
if bonusCondition then
player:addCondition(bonusCondition)
end
end
I'm using the code: Outfit bonus 1.2
##EDIT
The script below allows you to load bonuses immediately, the item will change the outfit, but it does not delete the previous ones (those from the previous outfit)
Lua:
dofile('data/events/scripts/creature.lua')
function onThink(player)
if player:hasOutfit(player:getOutfit().lookType, 3) then
local previousBonusCondition = getBonusCondition(player:getOutfit().lookType)
if previousBonusCondition then
player:removeCondition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
end
local bonusCondition = getBonusCondition(player:getOutfit().lookType)
player:removeCondition(bonusCondition)
return player:addCondition(bonusCondition)
end
end
Last edited: