Ir para conteúdo
  • Cadastre-se

(Resolvido)[Ajuda] Adicionar tempo pzlocker em script !


Ir para solução Resolvido por Gengo,

Posts Recomendados

  • Solução
  Em 30/04/2018 em 12:55, Jociel disse:

@Luis360 vo testa jaja digo o resultado

 

Edit:

Eu testei e deu o seguinte erro

[30/04/2018 09:58:26] [Error - LuaScriptInterface::loadFile] data/actions/scripts/bonus/mystic protector.lua:27: ')' expected near 'ï'
[30/04/2018 09:58:26] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/bonus/mystic protector.lua)
[30/04/2018 09:58:26] data/actions/scripts/bonus/mystic protector.lua:27: ')' expected near 'ï'

 

@Luis360

Expand   Mostrar mais  

 

Agora deve funcionar.

 

local config = {
	storageSummon = 7475,
	storageTime   = 7477,
	tempo         = 20 -- equivale a 20 segundos
}
 
local pet = {
	["Rinnegan [Protector]"] = {201,1000},
	["Rinnegan [Protector]"] = {201,1000}
}
 
function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
	
	if #getCreatureSummons(cid) > 1 then
     doPlayerSendCancel(cid,"Your Demonio is already summoned.")
	end
	
	if getPlayerStorageValue(cid,config.storageSummon) == 1 then
		local z = getCreatureSummons(cid)[1]
		addEvent(function()
			setPlayerStorageValue(cid, config.storageSummon, -1) 
			setPlayerStorageValue(cid, config.storageTime, os.time()+ config.tempo)	
		end, 100)		
		doCreatureSay(cid,"Back my summon!",TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(z), 2)
		doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 3)
		return doRemoveCreature(z)
	end	
	
	local summons = getCreatureSummons(cid)

	if ( not getTilePzInfo(getCreaturePosition(cid)) )  then	
		if ( getPlayerStorageValue(cid, config.storageTime) <= os.time() ) then
			for k,v in pairs(pet) do -- 1
				if getPlayerStorageValue(cid,config.storageSummon) < 1 then
					if getPlayerLevel(cid) >= v[1] and getPlayerLevel(cid) < v[2] then -- 2
						if (table.maxn(summons) < 1)then -- 3
							x = doSummonCreature(k, getCreaturePosition(cid))
							doConvinceCreature(cid, x)
							setPlayerStorageValue(cid,4194,1)
							setPlayerStorageValue(cid,config.storageSummon,1)
							doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
							doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 2)							
						end
					end
				end
			end	
		else
			return doCreatureSay(cid, "Espere "..config.storageTime.." para usar novamente", TALKTYPE_ORANGE_1)
		end
	else
		doCreatureSay(cid, "Voce nao pode usar em area Protection Zone", TALKTYPE_ORANGE_1)
	end
		
return true
end

 

OBS: Testei no meu otServ e está funcionando normal.

 

Link para o post
Compartilhar em outros sites
  • Respostas 6
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Opa blz, veja se esse script atende suas necessidades:   function onUse(cid, item, frompos, item2, topos) storage = 4191 storsol = 1203 tempo = 14400, --time com rolo que termina (em segundos 14400 = 4 horas) if #getCreatureSummons(cid) > 1 then doPlayerSendCancel(cid,"Voce ja chamou seu Protetor!.") end if getPlayerStorageValue(cid,storsol) == 1 then local z = getCreatureSummons(cid)[1] addEvent(setPlayerStorageValue,100,cid,storsol,-1) doPlayerSay(cid,"Volte Prote

Ops falha minha, na parte que está a variavel tempo , tem uma virgula, é só retirar ela.   function onUse(cid, item, frompos, item2, topos) storage = 4191 storsol = 1203 tempo = 14400 --time com rolo que termina (em segundos 14400 = 4 horas) if #getCreatureSummons(cid) > 1 then doPlayerSendCancel(cid,"Voce ja chamou seu Protetor!.") end if getPlayerStorageValue(cid,storsol) == 1 then local z = getCreatureSummons(cid)[1] addEvent(setPlayerStorageValue,100,cid,storsol,-

Agora deve funcionar.   local config = { storageSummon = 7475, storageTime = 7477, tempo = 20 -- equivale a 20 segundos } local pet = { ["Rinnegan [Protector]"] = {201,1000}, ["Rinnegan [Protector]"] = {201,1000} } function onUse(cid, item, fromPosition, target, toPosition, isHotkey) if #getCreatureSummons(cid) > 1 then doPlayerSendCancel(cid,"Your Demonio is already summoned.") end if getPlayerStorageValue(cid,config.storageSummon) == 1 then local z

@Luis360 

Cara Vlw Vc é um Gênio  

REP + 3

Vlw ?

 

EDIT:

 

@Luis360

 

se puder me ajuda em mais 1 pequeno bug agradeço !

 

quando um player usa o item ele chamar o protetor porem ele pode passar para outro player chamar o protetor ttbm!

se me ajuda nisso dou mais Rep+

Editado por Jociel
EDIT (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96843
    Tópicos
    519605
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo