Tenta assim:
local storage = 193879834 local tempo = 1*60 ----(1 minuto) local minutes = 5 function onAttack(cid, target) if isMonster(target) and getCreatureName(target):lower() == 'training monk' then strValue = getPlayerStorageValue(cid, storage) doPlayerSetStorageValue(cid, storage, strValue+1) if getPlayerStorageValue(cid, storage) >= tempo then doPlayerAddStamina(cid, minutes) doPlayerSetStorageValue(cid, storage, 0) end end return true end
Caso não dê certo, tente assim:
local storage = 193879834 local tempo = 1*60 ----(1 minuto) local minutes = 5 function onAttack(cid, target) if isMonster(target) and string.lower(getCreatureName(target)) == "training monk" then strValue = getPlayerStorageValue(cid, storage) doPlayerSetStorageValue(cid, storage, strValue+1) if getPlayerStorageValue(cid, storage) >= tempo then doPlayerAddStamina(cid, minutes) doPlayerSetStorageValue(cid, storage, 0) end end return true end



info
Grupo: Campones
Registrado: 26/05/15
Posts: 53
Reputação: 0
[Error - CreatureScript Interface]
data/creaturescripts/scripts/staminafiller.lua:onAttack
Description:
data/creaturescripts/scripts/staminafiller.lua:7: attempt to perform arithmetic on a string value
stack traceback:
data/creaturescripts/scripts/staminafiller.lua:7: in function <data/creaturescripts/scripts/staminafiller.lua:1>
function onAttack(cid, target)
local storage = 193879834
local tempo = 1*60 ----(1 minuto)
local minutes = 5
if isMonster(target) and getCreatureName(target):lower() == 'training monk' then
doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage)+1)
if getPlayerStorageValue(cid, storage) >= tempo then
doPlayerAddStamina(cid, minutes)
doPlayerSetStorageValue(cid, storage, 0)
end
end
return true
end