Caduceus
Unknown Member
- Joined
- May 10, 2010
- Messages
- 321
- Solutions
- 2
- Reaction score
- 24
Spell is to make the creature imitate the player outfit. Getting no errors, however, if I remove the "If not player then..." it returns as player is nil. How can I target the player, so it is not nil.
Code:
local combat = Combat()
function onTargetCreature(creature, target)
local player = Player(cid)
if not player then
return false
end
local outfit = player:getOutfit()
player:setOutfit(outfit)
end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onCastSpell(creature, var)
return combat:execute(creature, var)
end