Good day,
I'm trying to store a variable that captures the player's "old outfit/looktype" so I can revert back to it later if needed. I have created a new condition that changes the player's outfit, but I need to keep track of the previous look. Can you help me determine the best way to store the old outfit so I can revert back to it using a revert script? I want to ensure that I can melt the current outfit and return to the original one
I'm trying to store a variable that captures the player's "old outfit/looktype" so I can revert back to it later if needed. I have created a new condition that changes the player's outfit, but I need to keep track of the previous look. Can you help me determine the best way to store the old outfit so I can revert back to it using a revert script? I want to ensure that I can melt the current outfit and return to the original one
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
function onCastSpell(creature, var)
local targetCreature = Creature(var.number)
local playerDirection = targetCreature:getDirection()
if targetCreature:isPlayer() then
if playerDirection == WEST then
targetCreature:setOutfit({lookTypeEx = 7171})
elseif playerDirection == NORTH then
targetCreature:setOutfit({lookTypeEx = 7171})
elseif playerDirection == EAST then
targetCreature:setOutfit({lookTypeEx = 7306})
elseif playerDirection == SOUTH then
targetCreature:setOutfit({lookTypeEx = 7305})
end
end
end