roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 200
Hi, i use this spell in my server, but when the player die, the server crashes.
OBS: if a player who used the spell die, when the script is running, the server crashes.
OBS: if a player who used the spell die, when the script is running, the server crashes.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -3.2, 1, -5.2, 1)
function onCastSpell(cid, var)
local function Repeat_Effect(target, times)
if times > 0 then
if isCreature(cid) then
if isCreature(target) then
doSendMagicEffect(getCreaturePosition(target), 199)
doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(target), 15)
addEvent(Repeat_Effect,100,target,times-1)
end
end
end
end
local target = getCreatureTarget(cid)
Repeat_Effect(target,6)
return doCombat(cid, combat, var)
end
Last edited: