KylerXX
Active Member
- Joined
- Jun 24, 2010
- Messages
- 439
- Reaction score
- 30
PHP:
local outfit = getCreatureOutfit(getCreatureTarget(cid))
local vocout = {
[39] = {2}
}
function onCastSpell(cid, var)
if isPlayer(getCreatureTarget(cid)) then
doPlayerSetVocation(cid, getPlayerVocation(getCreatureTarget(cid)))
doPlayerSendCancel(cid, 'Now you are ' ..getPlayerVocationName(cid)..'!')
addEvent(doPlayerSetVocation, 1 * 60 * 1000, cid, 59)
addEvent(doCreatureChangeOutfit, 1 * 60 * 1000, cid, {lookType = 28, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0})
elseif isMonster(getCreatureTarget(cid)) then
doCreatureChangeOutfit(cid, getCreatureOutfit(getCreatureTarget(cid)))
addEvent(doCreatureChangeOutfit, 1 * 60 * 1000, cid, {lookType = 28, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0})
doPlayerSetVocation(cid, vocout[outfit][1])
addEvent(doPlayerSetVocation, 1 * 60 * 1000, cid, 59)
else
doPlayerSendCancel(cid, 'No has indicado al pokemon para utilizar este ataque!')
return false
end
return true
end
If I say this spell my outfit is exchanged for the monster, but also define what if the monster have "that" outfit, also changing the vocation indicated in black, but I get this damned error...:
[20/07/2010 02:29:31] Lua Script Error: [Spell Interface]
[20/07/2010 02:29:31] data/spells/scripts/summon/ditto.luanCastSpell
[20/07/2010 02:29:31] data/spells/scripts/summon/ditto.lua:16: attempt to index field '?' (a nil value)
[20/07/2010 02:29:31] stack traceback:
[20/07/2010 02:29:31] data/spells/scripts/summon/ditto.lua:16: in function <data/spells/scripts/summon/ditto.lua:7>