megazx
Graphic designer
hello i use this script for critical dmg and its working good but when i step on fire i get this err
[1:29:18.111] [Error - CreatureScript Interface]
[1:29:18.111] data/creaturescripts/scripts/critical.luanStatsChange
[1:29:18.112] Description:
[1:29:18.112] (luaGetCreatureStorage) Creature not found
tfs 0.4
creaturescripts/scripts/critical.lua
[1:29:18.111] [Error - CreatureScript Interface]
[1:29:18.111] data/creaturescripts/scripts/critical.luanStatsChange
[1:29:18.112] Description:
[1:29:18.112] (luaGetCreatureStorage) Creature not found
tfs 0.4
creaturescripts/scripts/critical.lua
Lua:
local lvlcrit = 48913
local multiplier = 2
local effect = 61
function onStatsChange(cid, attacker, stat, combat, value)
if(attacker == nil or isMonster(attacker)) then
return true
end
if attacker and attacker ~= nil then
if stat == STATSCHANGE_HEALTHLOSS or stat == STATSCHANGE_MANALOSS and isCreature(attacker) then
if type(getPlayerStorageValue(attacker, lvlcrit)) ~= "number" then
return true
end
if (getPlayerStorageValue(attacker, lvlcrit)*3) >= math.random (0,1000) then
dano = math.ceil(value*(multiplier))
doTargetCombatHealth(attacker, cid, combat, -dano, -dano, 255)
doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!!", 144)
doSendMagicEffect(getCreaturePos(cid), effect)
return false
end
end
end
return true
end