Ir para conteúdo
  • Cadastre-se

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


Ir para solução Resolvido por Gengo,

Posts Recomendados

Olá Galera hj peço que me ajudem nisso por favor!

 

Eu tenho um script  e esse script ao usa 1 item chama um Protetor porem nesse mesmo script eu queria que ele tivesse algumas coisas

tais como:

- tempo que poderar usa o item novamente  "sendo esse tempo podendo ser editado por eu ".

- Nao poder usar tal item em area protection zone.

 

Meu Script

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

storage = 4191
storsol = 1203
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 Protector!",TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(z), 2)
doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 16)
doRemoveCreature(z)
end

local summons = getCreatureSummons(cid)

local pet = {
["Rinnegan [Protector]"] = {201,1000},
["Rinnegan [Protector]"] = {201,1000}
}

for k,v in pairs(pet) do -- 1

if getPlayerStorageValue(cid,storsol) < 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,storsol,1)
doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 152)
end
end
end
end
return true
end

Valendo 3 REP+

Editado por Jociel (veja o histórico de edições)
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

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 Protector!",TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(z), 2)
		doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 16)
		doRemoveCreature(z)
	end

	local summons = getCreatureSummons(cid)

	local pet = {
		["Rinnegan [Protector]"] = {201,1000},
		["Rinnegan [Protector]"] = {201,1000}
	}

	if ( isPlayerPzLocked(cid) ) and (  getPlayerStorageValue(cid, storsol) <= os.time() ) then
		for k,v in pairs(pet) do -- 1
			if getPlayerStorageValue(cid,storsol) < 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,storsol,1)
						setPlayerStorageValue(cid, storsol, os.time()+tempo)
						doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
						doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 152)
					end
				end
			end
		end
	end
return true
end

 

Link para o post
Compartilhar em outros sites

@Luis360 

o Script parou de funcionar!

Deu os Seguntes Erros

 

[29/04/2018 18:51:24] [Error - LuaScriptInterface::loadFile] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if'
[29/04/2018 18:51:24] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/bonus/mystic protector.lua)
[29/04/2018 18:51:24] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if'
 

Editado por Jociel
Devidos erros (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  Em 29/04/2018 em 21:45, Jociel disse:

@Luis360 

o Script parou de funcionar!

Deu os Seguntes Erros

 

[29/04/2018 18:51:24] [Error - LuaScriptInterface::loadFile] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if'
[29/04/2018 18:51:24] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/bonus/mystic protector.lua)
[29/04/2018 18:51:24] data/actions/scripts/bonus/mystic protector.lua:7: unexpected symbol near 'if'
 

Expand   Mostrar mais  

 

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,-1)
		doPlayerSay(cid,"Volte Protector!",TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(z), 2)
		doSendDistanceShoot(getCreaturePosition(z), getPlayerPosition(cid), 16)
		doRemoveCreature(z)
	end

	local summons = getCreatureSummons(cid)

	local pet = {
		["Rinnegan [Protector]"] = {201,1000},
		["Rinnegan [Protector]"] = {201,1000}
	}

	if ( isPlayerPzLocked(cid) ) and (  getPlayerStorageValue(cid, storsol) <= os.time() ) then
		for k,v in pairs(pet) do -- 1
			if getPlayerStorageValue(cid,storsol) < 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,storsol,1)
						setPlayerStorageValue(cid, storsol, os.time()+tempo)
						doCreatureSay(cid, k ..", go!", TALKTYPE_ORANGE_1)
						doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 152)
					end
				end
			end
		end
	end
return true
end

 

Link para o post
Compartilhar em outros sites

@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

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