se n pois pra checa se tem target, e nem definiu se o target,dai ele n é achado
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true) setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if target ~= 0 and target ~= nill then doCreatureSetNoMove(target, true) addEvent(doCreatureSetNoMove, 5000, target, false) return doCombat(cid, combat, var) end end






info
Grupo: Campones
Registrado: 01/06/08
Posts: 45
Reputação: 0
Estava tentando criar uma magia que imobilizaria o target por 5 segundos, eu fiz a magia tudo corretamente... confiram no @edit..
@EDIT:
consegui fazer uma aqui:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
function onCastSpell(cid, var)
doCreatureSetNoMove(target, true)
addEvent(doCreatureSetNoMove, 5000, target, false)
return doCombat(cid, combat, var)
end
só que quando vou usar da o seguinte erro
Editado Março 15 por luakao