Mateus Robeerto
Excellent OT User
can someone convert to tfs 1x?
follow the error here \/
Lua Script Error: [Spell Interface]
data/spells/scripts/headcut.luanCastSpell
LuaScriptInterface::luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/spells/scripts/headcut.lua:62: in function <data/spells/scripts/headcut.lua:44>
C++:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0, -3500, -0, -3500)
local condition = createConditionObject(CONDITION_EMO)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 10, 1000, -3000)
setCombatCondition(combat, condition)
arr = {
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function onCastSpell(cid, var)
local rand = math.random(1,50)
if rand == 1 and isPlayer(cid) == 1 then
doCreatureSay(cid,"Bleed!",16)
elseif rand == 2 and isPlayer(cid) == 1 then
doCreatureSay(cid,"Bleed!",16)
elseif rand == 3 and isPlayer(cid) == 1 then
doCreatureSay(cid,"Bleed!",16)
elseif rand == 4 and isPlayer(cid) == 1 then
doCreatureSay(cid,"Bleed!",16)
end
return doCombat(cid, combat, var)
end
local function Cooldown(cid)
if isPlayer(cid) == TRUE then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'CD: Lamina Mortal.')
end
end
local exhausted_seconds = 5 -- Segundos que o Player Poderá castar a spell novamente
local exhausted_storagevalue = 94346834656742 -- Storage Value do Cool Down
function onCastSpell(cid, var)
if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
doPlayerSendCancel(cid,'O Cooldown não está pronto.')
return TRUE
end
rand = math.random(1,1)
if rand == 1 and isPlayer(cid) == 1 then
doCreatureSay(cid,"Exori Bleed!",16)
addEvent(Cooldown, 1*4900,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
elseif rand == 2 and isPlayer(cid) == 1 then
doCreatureSay(cid,"Exori Bleed!",16)
addEvent(Cooldown, 1*4900,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
else
addEvent(Cooldown, 1*4900,cid)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
return doCombat(cid, combat, var)
end
end
follow the error here \/
Lua Script Error: [Spell Interface]
data/spells/scripts/headcut.luanCastSpell
LuaScriptInterface::luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/spells/scripts/headcut.lua:62: in function <data/spells/scripts/headcut.lua:44>