Estou com um erro no meu script... toda vez que eu ataco um bicho, no executavel do server aparece este erro:
E o Script exphit.lua é esse:
-- ExpHit por Stage by Uissu
local rateExp = getConfigValue('rateExperience') or 1
local useStages = true
local tableStages = { -- {min,max or -1,rate}
{1,75,200},{76,150,100},{151,200,50},{201,275,35},{276,300,25},{301,350,15},{351,375,10},{376,400,5},{401,425,3},{426,-1,1}
}
function getPlayerStageRate(cid, table) -- by Uissu
for _,v in ipairs(table) do
if getPlayerLevel(cid) >= v[1] and (v[2] == -1 or getPlayerLevel(cid) <= v[2]) then
rate = v[3]
break
end
end
return rate
end
function CalculeExp(monsterhp, exptotal, hit)
local x = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0
local x2 = x - 20 + math.random(20)
return x2 > 0 and x2 or 0
end
function isSummon(uid)
return uid ~= getCreatureMaster(uid) or false
end
function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS then
if isMonster(cid) then
if isCreature(attacker) then
local sid = isSummon(attacker) == true and getCreatureMaster(attacker) or attacker
if isPlayer(sid) then
stageRate = getPlayerStageRate(cid, tableStages)
local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp, value)
doSendAnimatedText(getThingPos(sid), useStages and expg * stageRate or expg, 215)
doPlayerAddExp(sid, useStages and expg * stageRate or expg)
end
end
end
elseif type == STATSCHANGE_HEALTHGAIN then
return false
end
return true
end
function onCombat(cid, target)
if isMonster(target) and not isSummon(target) and not isPlayer(target) then
registerCreatureEvent(target, "ExpGain")
end
return true
end
QUAL o erro desse script?? Poste pra mim como seria o certo disso... Obrigado pela ajuda....