[Resolvido] colocar exaustão nesse item

Emooooo
em Resolvidos

Emooooo

Stalingrado
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 01/07/18Posts: 118Gênero: Masculino

colocar exaustão de 1 hora para poder usar novamente !

 

 

 

+rep 

Crypter

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 24/02/17Posts: 368Gênero: Masculino
local outfits = {"rat", "ghost", "chicken", "pig"} -- outfits (randomicos)
local duration = 45 -- tempo de duraçao dos outfits (em segundos)
local breakchance = 90 --chance de perder a varinha magica

local exhaustion_time = 1 * * 60 * 60
local exhaustion_storage = 109000

function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	if not isPlayer(itemEx.uid) then
		doPlayerSendCancel(cid, "Use only on players.")
		return true
	elseif exhaustion.check(cid, exhaustion_storage) then
		doPlayerSendCancel(cid, "Wait " .. exhaustion.get(cid, exhaustion_storage) .. " seconds.")
		return true
	end
	
	if math.random(100) <= breakchance then
		local pos = getClosestFreeTile(cid, toPosition, true, false)
		if isWalkable(pos) then
			doSummonCreature("Mad Sheep", pos)
			doSendMagicEffect(pos, CONST_ME_SOUND_BLUE)
		end
		doRemoveItem(item.uid, 1)
	else
		doSetMonsterOutfit(itemEx.uid, outfits[math.random(#outfits)], duration * 1000)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
	end
	
	exhaustion.set(cid, exhaustion_storage, exhaustion_time)
	return true
end

 

Emooooo

Stalingrado
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 01/07/18Posts: 118Gênero: Masculino
16 horas atrás, Crypter disse:
local outfits = {"rat", "ghost", "chicken", "pig"} -- outfits (randomicos)
local duration = 45 -- tempo de duraçao dos outfits (em segundos)
local breakchance = 90 --chance de perder a varinha magica

local exhaustion_time = 1 * * 60 * 60
local exhaustion_storage = 109000

function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	if not isPlayer(itemEx.uid) then
		doPlayerSendCancel(cid, "Use only on players.")
		return true
	elseif exhaustion.check(cid, exhaustion_storage) then
		doPlayerSendCancel(cid, "Wait " .. exhaustion.get(cid, exhaustion_storage) .. " seconds.")
		return true
	end
	
	if math.random(100) <= breakchance then
		local pos = getClosestFreeTile(cid, toPosition, true, false)
		if isWalkable(pos) then
			doSummonCreature("Mad Sheep", pos)
			doSendMagicEffect(pos, CONST_ME_SOUND_BLUE)
		end
		doRemoveItem(item.uid, 1)
	else
		doSetMonsterOutfit(itemEx.uid, outfits[math.random(#outfits)], duration * 1000)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
	end
	
	exhaustion.set(cid, exhaustion_storage, exhaustion_time)
	return true
end

 

[01/04/2019 12:06:25] [Error - LuaScriptInterface::loadFile] data/actions/scripts/tools/spellwand.lua:5: unexpected symbol near '*'
[01/04/2019 12:06:25] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/tools/spellwand.lua)
[01/04/2019 12:06:25] data/actions/scripts/tools/spellwand.lua:5: unexpected symbol near '*'

gabriel28

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/10Posts: 429Gênero: MasculinoChar no Tibia: Gabriel Rookgaardian

@Emooooo
Troca:

local exhaustion_time = 1 * * 60 * 60

Por:
local exhaustion_time = 1 * 60 * 60

Emooooo

Stalingrado
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 01/07/18Posts: 118Gênero: Masculino
13 minutos atrás, gabriel28 disse:

@Emooooo
Troca:

local exhaustion_time = 1 * * 60 * 60

Por:
local exhaustion_time = 1 * 60 * 60

[01/04/2019 19:09:39] [Error - LuaScriptInterface::loadFile] data/actions/scripts/tools/spellwand.lua:5: unexpected symbol near 'ï'
[01/04/2019 19:09:39] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/tools/spellwand.lua)
[01/04/2019 19:09:39] data/actions/scripts/tools/spellwand.lua:5: unexpected symbol near 'ï'

gabriel28

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/10Posts: 429Gênero: MasculinoChar no Tibia: Gabriel Rookgaardian

@Emooooo
Parece que quando você colou lá, trocou por um caractere especial. Reescreve 'exhaustion_time' no script e fica atento se não tem nenhum outro caractere especial. 

Yan Liima

Scripter,Programador,WebMaster.
avatar
Diretor
Diretor

INFOS

Grupo: DiretorRegistrado: 12/05/12Posts: 818Gênero: MasculinoChar no Tibia: [ADM] Night
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.

════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═══╗

ALGUNS DOS MEUS TRABALHOS:

Spoiler

WODBOHS[DOWNLOAD]

Newstory dbo+nto+bleach[DOWNLOAD]

 

>> Mais infos <<

- Projetos lançados também feitos por mim {

DBO SKY

POKE SKY

WODBOWARS

Tic-tac-War

Dbo Universe(em desenvolvimento)

}

universe.thumb.png.6840320998d0fc1a4652b3db81a585c0.png

Separador.PNG

Te Ajudei? Rep + e ficamos Quits

imageproxy.png.84dce08dd18d31663a72aa1ce37b858a.png

Precisando de ajuda?

discord.png.1ecd188791d0141f74d99db371a2e0a4.pngDiscord: Yan Liima #3702

Programador Júnior de LUA, PHP e JavaScript

Juntos somos lendas, separados somos Mitos!

╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝