Ir para conteúdo
  • 0

Revive Com Tempo


KaboFlow

Pergunta

10 respostass a esta questão

Posts Recomendados

  • 0
Em 08/04/2021 em 18:37, KaboFlow disse:

é que consegui um revive de outro servidor que está por nível mas não tem tempo em 10 minutos

 

 

  Mostrar conteúdo oculto

local level = 100
function onUse(cid, item, frompos, item2, topos)
    if (item2.itemid == 13860 or item2.itemid == 13810) and (getPlayerGroupId(cid) < 1 or getPlayerGroupId(cid) > 6) then
        doRemoveItem(item2.uid)
        return true
    end
    if getPlayerStorageValue(cid, 990) >= 1 then
        doPlayerSendCancel(cid, "Você não pode usar reviver durante as batalhas de ginasio.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
        return true
    elseif getPlayerStorageValue(cid, 52481) >= 1 then
        doPlayerSendCancel(cid, "Você não pode fazer isso enquanto um duelo.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n") --alterado v1.6
        return true
    elseif isPlayer(item2.uid) then
        doPlayerSendCancel(cid, "Por favor, use revive apenas em pokemons dentro de suas pokebolas!.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
        return true
    elseif getPlayerLevel(cid) > level then
        return doPlayerSendCancel(cid, "Você ultrapassou o level limite para usar este Revive.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
    end
    if item2.uid ~= getPlayerSlotItem(cid, 8).uid then
        return true
    end
    if item2.uid ~= getPlayerSlotItem(cid, 8).uid and not isInArray(getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid), item2.uid) then 
        return true 
    end
    for a, b in pairs (pokeballs) do
        if not item2.itemid == b.on or not item2.itemid == b.off then
            doPlayerSendCancel(cid, "Por favor, use revive apenas em pokémons dentro de suas pokebolas!.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
            return true
        end
    end
 
    local pokeball = getPlayerSlotItem(cid, ?
    for a, b in pairs (pokeballs) do
        if item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXG
            doTransformItem(item2.uid, b.on)
            doSetItemAttribute(item2.uid, "hp", 1)
            for c = 1, 15 do
                local str = "move"..c
                setCD(item2.uid, str, 0)
            end
            setCD(item2.uid, "control", 0)
            setCD(item2.uid, "blink", 0) --alterado v1.6
            doSendMagicEffect(getThingPos(cid), 13)
            doRemoveItem(item.uid, 1)
            setPlayerStorageValue(cid, 1008, 100)
            doCureBallStatus(getPlayerSlotItem(cid, 8).uid, "all")
            doCureStatus(cid, "all", true)
            cleanBuffs2(item2.uid) --alterado v1.5
 
            --[[if getPlayerStorageValue(cid, storage) > 0 then
                setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage)-1)
            end--]]
            return true
        end
    end
    return true
end

 

Entendi, troque o código por esse:

 

local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE
local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE
local minutes = 10 -- MINUTOS PARA USAR O REVIVE
local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO

--------------- CÓDIGO ---------------

function onUse(cid, item, frompos, item2, topos)

	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.")
	return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.")
	
	else
		if getPlayerStorageValue(cid, storage_time) <= os.time() then
			
			if getPlayerStorageValue(cid, 990) >= 1 then
				doPlayerSendCancel(cid, "You can't use revive during gym battles.")
			return true
			end
	
			if getPlayerStorageValue(cid, 52481) >= 1 then
				return doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6
			end
						--
			if item2.itemid <= 0 or not isPokeball(item2.itemid) then
				doPlayerSendCancel(cid, "Please, use revive only on pokeballs.")
			return true
			end

			for a, b in pairs (pokeballs) do
				if item2.itemid == b.on or item2.itemid == b.off then      
					doTransformItem(item2.uid, b.on)
					doSetItemAttribute(item2.uid, "hp", 1)
					
					for c = 1, 15 do
						local str = "move"..c
						setCD(item2.uid, str, 0)
					end
					
					setCD(item2.uid, "control", 0)
					setCD(item2.uid, "blink", 0)  --alterado v1.6
					doSendMagicEffect(getThingPos(cid), 13)
					doRemoveItem(item.uid, 1)
					doCureBallStatus(item2.uid, "all")
					cleanBuffs2(item2.uid)   
                    setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes)) 
				
				return true
				end
			end
			
														
		else
			doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.")
		return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.")
		end
	end
		
return true
end

 

Editado por Yan18
Link para o comentário
Compartilhar em outros sites

  • 0

Sem spam, aguarde ser respondido.

 

Quando for postar um código, poste ele inteiro, pois o que você colocou estava faltando parte (ou estava errado rsrs).

 

Troque o código por esse:

 

local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE
local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE
local minutes = 10 -- MINUTOS PARA USAR O REVIVE
local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO

--------------- CÓDIGO ---------------

function onUse(cid, item, frompos, item2, topos)
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.")
	return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.")
		
	else
		if getPlayerStorageValue(cid, storage_time) <= os.time() then
			setPlayerStorageValue(cid, 8422, 0) 
			setPlayerStorageValue(cid, 23254, 50)
					
			if isCreature(item2.uid) then
				return doPlayerSendCancel(cid, "You can only use revive in pokeballs!")
			end
			
			if isPlayer(item2.uid) then
				return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")
			end
			
			local x = pokeballs[getPokeballType(item2.itemid)]
		
			if not x or isInArray(x.use, item2.itemid) then return doPlayerSendCancel(cid, "Sorry, is not possible.") end
				if x.on or x.off then
					doSendMagicEffect(getThingPos(cid), 14)
					doRemoveItem(item.uid, 1)
					maxh = tonumber(getItemAttribute(item2.uid, "poke"):match("/(.+)]"))
					doItemSetAttribute(item2.uid, "poke", getItemAttribute(item2.uid, "poke"):sub(1, findLetter(getItemAttribute(item2.uid, "poke"), "[")) .. maxh .. getItemAttribute(item2.uid, "poke"):sub(findLetter(getItemAttribute(item2.uid, "poke"), "/")))
					btype = getPokeballType(item2.itemid)
					ons = pokeballs[btype].on
					doTransformItem(item2.uid, ons)
					doCureAllStatus(item2.uid)
					setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes))
				return true	
				
				else
					doPlayerSendCancel(cid, "Sorry, is not possible.")
				return true
				end 

			else
				return true
			end
			
		else
			doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.")
		return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.")
		end	
	end	
end	

 

Editado por Yan18
Link para o comentário
Compartilhar em outros sites

  • 0
4 horas atrás, Yan18 disse:

Sem spam, aguarde ser respondido.

 

Quando for postar um código, poste ele inteiro, pois o que você colocou estava faltando parte (ou estava errado rsrs).

 

Troque o código por esse:

 


local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE
local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE
local minutes = 10 -- MINUTOS PARA USAR O REVIVE
local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO

--------------- CÓDIGO ---------------

function onUse(cid, item, frompos, item2, topos)
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.")
	return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.")
		
	else
		if getPlayerStorageValue(cid, storage_time) <= os.time() then
			setPlayerStorageValue(cid, 8422, 0) 
			setPlayerStorageValue(cid, 23254, 50)
					
			if isCreature(item2.uid) then
				return doPlayerSendCancel(cid, "You can only use revive in pokeballs!")
			end
			
			if isPlayer(item2.uid) then
				return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")
			end
			
			local x = pokeballs[getPokeballType(item2.itemid)]
		
			if not x or isInArray(x.use, item2.itemid) then return doPlayerSendCancel(cid, "Sorry, is not possible.") end
				if x.on or x.off then
					doSendMagicEffect(getThingPos(cid), 14)
					doRemoveItem(item.uid, 1)
					maxh = tonumber(getItemAttribute(item2.uid, "poke"):match("/(.+)]"))
					doItemSetAttribute(item2.uid, "poke", getItemAttribute(item2.uid, "poke"):sub(1, findLetter(getItemAttribute(item2.uid, "poke"), "[")) .. maxh .. getItemAttribute(item2.uid, "poke"):sub(findLetter(getItemAttribute(item2.uid, "poke"), "/")))
					btype = getPokeballType(item2.itemid)
					ons = pokeballs[btype].on
					doTransformItem(item2.uid, ons)
					doCureAllStatus(item2.uid)
					setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes))
				return true	
				
				else
					doPlayerSendCancel(cid, "Sorry, is not possible.")
				return true
				end 

			else
				return true
			end
			
		else
			doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.")
		return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.")
		end	
	end	
end	

 

 

[08/04/2021 14:09:29] [Error - LuaScriptInterface::loadFile] data/actions/scripts/Nightmare Revive.lua:50: 'end' expected (to close 'if' at line 9) near 'else'
[08/04/2021 14:09:29] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/Nightmare Revive.lua)
[08/04/2021 14:09:29] data/actions/scripts/Nightmare Revive.lua:50: 'end' expected (to close 'if' at line 9) near 'else'

Link para o comentário
Compartilhar em outros sites

  • 0
1 hora atrás, KaboFlow disse:

 

[08/04/2021 14:09:29] [Error - LuaScriptInterface::loadFile] data/actions/scripts/Nightmare Revive.lua:50: 'end' expected (to close 'if' at line 9) near 'else'
[08/04/2021 14:09:29] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/Nightmare Revive.lua)
[08/04/2021 14:09:29] data/actions/scripts/Nightmare Revive.lua:50: 'end' expected (to close 'if' at line 9) near 'else'

Troque o código por esse:

 

local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE
local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE
local minutes = 10 -- MINUTOS PARA USAR O REVIVE
local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO

--------------- CÓDIGO ---------------

function onUse(cid, item, frompos, item2, topos)
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.")
	return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.")
		
	else
		if getPlayerStorageValue(cid, storage_time) <= os.time() then
			setPlayerStorageValue(cid, 8422, 0) 
			setPlayerStorageValue(cid, 23254, 50)
					
			if isCreature(item2.uid) then
				return doPlayerSendCancel(cid, "You can only use revive in pokeballs!")
			end
			
			if isPlayer(item2.uid) then
				return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")
			end
			
			local x = pokeballs[getPokeballType(item2.itemid)]
		
			if not x or isInArray(x.use, item2.itemid) then 
				return doPlayerSendCancel(cid, "Sorry, is not possible.") 
			end
			
			if x.on or x.off then
				doSendMagicEffect(getThingPos(cid), 14)
				doRemoveItem(item.uid, 1)
				maxh = tonumber(getItemAttribute(item2.uid, "poke"):match("/(.+)]"))
				doItemSetAttribute(item2.uid, "poke", getItemAttribute(item2.uid, "poke"):sub(1, findLetter(getItemAttribute(item2.uid, "poke"), "[")) .. maxh .. getItemAttribute(item2.uid, "poke"):sub(findLetter(getItemAttribute(item2.uid, "poke"), "/")))
				btype = getPokeballType(item2.itemid)
				ons = pokeballs[btype].on
				doTransformItem(item2.uid, ons)
				doCureAllStatus(item2.uid)
				setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes))
			return true	
			
			else
				doPlayerSendCancel(cid, "Sorry, is not possible.")
			return true
			end 
			
		else
			doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.")
		return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.")
		end	
	end	
end	

 

Link para o comentário
Compartilhar em outros sites

  • 0
26 minutos atrás, Yan18 disse:

Troque o código por esse:

 


local level = 200 -- LEVEL MÍNIMO PARA USAR O REVIVE
local storage_time = 68789 -- STORAGE PARA VERIFICAR O TEMPO PARA USAR O REVIVE
local minutes = 10 -- MINUTOS PARA USAR O REVIVE
local message_color = MESSAGE_STATUS_CONSOLE_BLUE -- COR DO TEXTO

--------------- CÓDIGO ---------------

function onUse(cid, item, frompos, item2, topos)
	if getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, "You need to be at least level " .. level .. " to use this revive.")
	return doPlayerSendTextMessage(cid, message_color, "You need to be at least level " .. level .. " to use this revive.")
		
	else
		if getPlayerStorageValue(cid, storage_time) <= os.time() then
			setPlayerStorageValue(cid, 8422, 0) 
			setPlayerStorageValue(cid, 23254, 50)
					
			if isCreature(item2.uid) then
				return doPlayerSendCancel(cid, "You can only use revive in pokeballs!")
			end
			
			if isPlayer(item2.uid) then
				return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")
			end
			
			local x = pokeballs[getPokeballType(item2.itemid)]
		
			if not x or isInArray(x.use, item2.itemid) then 
				return doPlayerSendCancel(cid, "Sorry, is not possible.") 
			end
			
			if x.on or x.off then
				doSendMagicEffect(getThingPos(cid), 14)
				doRemoveItem(item.uid, 1)
				maxh = tonumber(getItemAttribute(item2.uid, "poke"):match("/(.+)]"))
				doItemSetAttribute(item2.uid, "poke", getItemAttribute(item2.uid, "poke"):sub(1, findLetter(getItemAttribute(item2.uid, "poke"), "[")) .. maxh .. getItemAttribute(item2.uid, "poke"):sub(findLetter(getItemAttribute(item2.uid, "poke"), "/")))
				btype = getPokeballType(item2.itemid)
				ons = pokeballs[btype].on
				doTransformItem(item2.uid, ons)
				doCureAllStatus(item2.uid)
				setPlayerStorageValue(cid, storage_time, os.time() + (60 * minutes))
			return true	
			
			else
				doPlayerSendCancel(cid, "Sorry, is not possible.")
			return true
			end 
			
		else
			doPlayerSendCancel(cid, "You need to wait " .. minutes .. " minutes to use this revive.")
		return doPlayerSendTextMessage(cid, message_color, "You need to wait " .. minutes .. " minutes to use this revive.")
		end	
	end	
end	

 

 

 

[08/04/2021 15:39:00] [Error - Action Interface] 
[08/04/2021 15:39:00] data/actions/scripts/potion/Nightmare Revive.lua:onUse
[08/04/2021 15:39:00] Description: 
[08/04/2021 15:39:00] data/actions/scripts/potion/Nightmare Revive.lua:35: attempt to index a nil value
[08/04/2021 15:39:00] stack traceback:
[08/04/2021 15:39:00]     data/actions/scripts/potion/Nightmare Revive.lua:35: in function <data/actions/scripts/potion/Nightmare Revive.lua:8>

 

 

Posso usar o revive com o Pokémon fora ..
e posso usá-lo sem tempo.

revive.png.cacd6c5e32c4f2dfec0dadb97cb411a9.png

 

 

 

 

Link para o comentário
Compartilhar em outros sites

  • 0
5 minutos atrás, KaboFlow disse:

 

 

[08/04/2021 15:39:00] [Error - Action Interface] 
[08/04/2021 15:39:00] data/actions/scripts/potion/Nightmare Revive.lua:onUse
[08/04/2021 15:39:00] Description: 
[08/04/2021 15:39:00] data/actions/scripts/potion/Nightmare Revive.lua:35: attempt to index a nil value
[08/04/2021 15:39:00] stack traceback:
[08/04/2021 15:39:00]     data/actions/scripts/potion/Nightmare Revive.lua:35: in function <data/actions/scripts/potion/Nightmare Revive.lua:8>

 

 

Posso usar o revive com o Pokémon fora ..
e posso usá-lo sem tempo.

revive.png.cacd6c5e32c4f2dfec0dadb97cb411a9.png

 

 

 

 

Qual a base do seu ot? É DXP?

Link para o comentário
Compartilhar em outros sites

  • 0

Eu tinha baixado essa base em 2019, mas o arquivo do revive está bem diferente do que eu tenho aqui. Poste novamente o arquivo revive.lua, mas poste tudo, pois esse que colocou na criação do tópicos parece que faltou partes. Edita lá mesmo e coloca lá. Ai eu dou uma olhada melhor.

Link para o comentário
Compartilhar em outros sites

  • 0
18 minutos atrás, Yan18 disse:

Eu tinha baixado essa base em 2019, mas o arquivo do revive está bem diferente do que eu tenho aqui. Poste novamente o arquivo revive.lua, mas poste tudo, pois esse que colocou na criação do tópicos parece que faltou partes. Edita lá mesmo e coloca lá. Ai eu dou uma olhada melhor.

é que consegui um revive de outro servidor que está por nível mas não tem tempo em 10 minutos

 

 

Spoiler

local level = 100
function onUse(cid, item, frompos, item2, topos)
    if (item2.itemid == 13860 or item2.itemid == 13810) and (getPlayerGroupId(cid) < 1 or getPlayerGroupId(cid) > 6) then
        doRemoveItem(item2.uid)
        return true
    end
    if getPlayerStorageValue(cid, 990) >= 1 then
        doPlayerSendCancel(cid, "Você não pode usar reviver durante as batalhas de ginasio.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
        return true
    elseif getPlayerStorageValue(cid, 52481) >= 1 then
        doPlayerSendCancel(cid, "Você não pode fazer isso enquanto um duelo.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n") --alterado v1.6
        return true
    elseif isPlayer(item2.uid) then
        doPlayerSendCancel(cid, "Por favor, use revive apenas em pokemons dentro de suas pokebolas!.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
        return true
    elseif getPlayerLevel(cid) > level then
        return doPlayerSendCancel(cid, "Você ultrapassou o level limite para usar este Revive.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
    end
    if item2.uid ~= getPlayerSlotItem(cid, 8).uid then
        return true
    end
    if item2.uid ~= getPlayerSlotItem(cid, 8).uid and not isInArray(getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid), item2.uid) then 
        return true 
    end
    for a, b in pairs (pokeballs) do
        if not item2.itemid == b.on or not item2.itemid == b.off then
            doPlayerSendCancel(cid, "Por favor, use revive apenas em pokémons dentro de suas pokebolas!.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
            return true
        end
    end
 
    local pokeball = getPlayerSlotItem(cid, ?
    for a, b in pairs (pokeballs) do
        if item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXG
            doTransformItem(item2.uid, b.on)
            doSetItemAttribute(item2.uid, "hp", 1)
            for c = 1, 15 do
                local str = "move"..c
                setCD(item2.uid, str, 0)
            end
            setCD(item2.uid, "control", 0)
            setCD(item2.uid, "blink", 0) --alterado v1.6
            doSendMagicEffect(getThingPos(cid), 13)
            doRemoveItem(item.uid, 1)
            setPlayerStorageValue(cid, 1008, 100)
            doCureBallStatus(getPlayerSlotItem(cid, 8).uid, "all")
            doCureStatus(cid, "all", true)
            cleanBuffs2(item2.uid) --alterado v1.5
 
            --[[if getPlayerStorageValue(cid, storage) > 0 then
                setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage)-1)
            end--]]
            return true
        end
    end
    return true
end

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...