Ir para conteúdo
  • 0

erro no script


macalo

Pergunta


[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

 

 

 

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

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
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...