Ir para conteúdo
  • Cadastre-se

(Resolvido)Ajuda com esse script efeito quando player logar [SCRIPT]


Ir para solução Resolvido por Sun,

Posts Recomendados

  • Moderador
  • Solução
local tabela_infos = {
 [0] = {  Effect = 123, Storage = 259005,  text = "Shinobi",     color = COLOR_GREEN,      efeito = 1}, -- ## [valor da storage] ## --
 [1] = {  Effect = 123, Storage = 259005,  text = "Genin",       color = COLOR_DARKBROWN,  efeito = 2}, -- ## [valor da storage] ## --
 [2] = {  Effect = 123, Storage = 259005,  text = "Chunin",      color = COLOR_YELLOW,     efeito = 2}, -- ## [valor da storage] ## --
 [3] = {  Effect = 123, Storage = 259005,  text = "Jounin",      color = COLOR_LIGHTGREEN, efeito = 2}, -- ## [valor da storage] ## --
 [4] = {  Effect = 123, Storage = 259005,  text = "Akatsuki",    color = COLOR_DARKRED,    efeito = 2}, -- ## [valor da storage] ## --
 [5] = {  Effect = 123, Storage = 259005,  text = "Captao A.",   color = COLOR_WHITE,      efeito = 2},  -- ## [valor da storage] ## --
 [6] = {  Effect = 123, Storage = 259005,  text = "Anbu",        color = COLOR_RED,        efeito = 2}  -- ## [valor da storage] ## --
}

function onLogin(cid)
 for value, dados in pairs(tabela_infos) do
  if getPlayerStorageValue(cid, dados.Storage) == value then
	 doSendMagicEffect(getPlayerPosition(cid), dados.efeito)
	 doSendAnimatedText(getPlayerPosition(cid), dados.text, dados.color)
     end
    end
  return true
end 

 

agora em login.lua, cole isto acima do registerCreatureEvent

	if getPlayerStorageValue(cid, 259005) == -1 then
		setPlayerStorageValue(cid, 259005, 0)
	end

 

e agora junto com registerCreatureEvent cole isto.

registerCreatureEvent(cid, "efeito")

 

e agora em creaturescript.xml

<event type="login" name="efeito" event="script" value="efeito.lua"/>

 

 

Este gif é para lhe mostrar como ficou, eu já configurei tudo para você, não precisa alterar nada além de efeito e text.

OBS: O ISTO É APENAS UMA ILUSTRAÇÃO, OU SEJA SE O PLAYER LOGAR NÃO IRA TROCAR O TEXTO SE ELE TIVER COM O VALOR DE SHINOBI.

               efetio.thumb.gif.ef920f323c5a7a54c0296e6f6c753855.gif

 

@KR33

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites

Agora os erros estão explicados.  
Finalizei o script do Sun, colocando os efeitos pra saírem por 5 segundos e centralizados devidamente no char. 
 

Spoiler


local function sendEff(cid, eff, times)
	local center = getPlayerPosition(cid)
	local offset = {x = center.x+1, y = center.y, z = center.z}
	if times > 0 then
		if isCreature(cid) then
			doSendMagicEffect(offset, eff)
			addEvent(sendEff, 1000, cid, eff, times-1)
		end
	end
end

local tabela_infos = {
[0] = {Effect = 1, Storage = 259005,  text = "Shinobi",     color = COLOR_GREEN,      efeito = 1}, 
[1] = {Effect = 2, Storage = 259005,  text = "Genin",       color = COLOR_DARKBROWN,  efeito = 2}, 
[2] = {Effect = 3, Storage = 259005,  text = "Chunin",      color = COLOR_YELLOW,     efeito = 2},
[3] = {Effect = 4, Storage = 259005,  text = "Jounin",      color = COLOR_LIGHTGREEN, efeito = 2}, 
[4] = {Effect = 5, Storage = 259005,  text = "Akatsuki",    color = COLOR_DARKRED,    efeito = 2}, 
[5] = {Effect = 6, Storage = 259005,  text = "Captao A.",   color = COLOR_WHITE,      efeito = 2}, 
[6] = {Effect = 7, Storage = 259005,  text = "Anbu",        color = COLOR_RED,        efeito = 2},
}

function onLogin(cid)
	print("HEHEXD")
	for value, dados in pairs(tabela_infos) do
		if getPlayerStorageValue(cid, dados.Storage) == value then
			sendEff(cid, dados.efeito, 5) -- Repetir o efeito por 5 segundos.
			doSendAnimatedText(getPlayerPosition(cid), dados.text, dados.color)
		end
	end
	return true
end 

 

 

Editado por 139
Agora ta funcionando certinho. (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
5 horas atrás, 139 disse:

Agora os erros estão explicados.  
Finalizei o script do Sun, colocando os efeitos pra saírem por 5 segundos e centralizados devidamente no char. 
 

  Mostrar conteúdo oculto


local function sendEff(cid, eff, times)
	local center = getPlayerPosition(cid)
	local offset = {x = center.x+1, y = center.y, z = center.z)
	if times > 0 then
		if isCreature(cid) then
			doSendMagicEffect(offset, eff)
			addEvent(sendEff, 1000, cid, eff, times-1)
		end
	end
end

local tabela_infos = {
[0] = {Effect = 123, Storage = 259005,  text = "Shinobi",     color = COLOR_GREEN,      efeito = 1}, -- ## [valor da storage] ## --
[1] = {Effect = 123, Storage = 259005,  text = "Genin",       color = COLOR_DARKBROWN,  efeito = 2}, -- ## [valor da storage] ## --
[2] = {Effect = 123, Storage = 259005,  text = "Chunin",      color = COLOR_YELLOW,     efeito = 2}, -- ## [valor da storage] ## --
[3] = {Effect = 123, Storage = 259005,  text = "Jounin",      color = COLOR_LIGHTGREEN, efeito = 2}, -- ## [valor da storage] ## --
[4] = {Effect = 123, Storage = 259005,  text = "Akatsuki",    color = COLOR_DARKRED,    efeito = 2}, -- ## [valor da storage] ## --
[5] = {Effect = 123, Storage = 259005,  text = "Captao A.",   color = COLOR_WHITE,      efeito = 2},  -- ## [valor da storage] ## --
[6] = {Effect = 123, Storage = 259005,  text = "Anbu",        color = COLOR_RED,        efeito = 2}  -- ## [valor da storage] ## --
}

function onLogin(cid)
	for value, dados in pairs(tabela_infos) do
		if getPlayerStorageValue(cid, dados.Storage) == value then
			sendEff(cid, dados.efeito, 5) <-- Repetir o efeito por 5 segundos.
			doSendAnimatedText(getPlayerPosition(cid), dados.text, dados.color)
		end
	end
	return true
end 

 


PS: Minhas alterações não foram testadas.

 

 

Opa irmão não funcionou 

fiz assim configurei meus efeitos queria que o efeito saisse em cima do player sabe? e tipo e loga aparece efeito  e sai tendeu

o script que o amigo ai fez funcinou 100% mas quando coloco as linhas que vc passou para.

 

Spoiler

local function sendEff(cid, eff, times)
local center = getPlayerPosition(cid)
local offset = {x = center.x+1, y = center.y, z = center.z)
    if times > 0 then
        if isCreature(cid) then
            doSendMagicEffect(offset, eff)
            addEvent(sendEff, 1000, cid, eff, times-1)
    end
    end
end

local tabela_infos = {
 [0] = {  Effect = 123, Storage = 259005,    text = "Aluno",       color = COLOR_GREEN,      efeito = 1002}, -- ## [valor da storage] ## --
 [1] = {  Effect = 123, Storage = 259005, 1,  text = "Genin",       color = COLOR_DARKBROWN,  efeito = 1001}, -- ## [valor da storage] ## --
 [2] = {  Effect = 123, Storage = 259005, 2,  text = "Chunin",      color = COLOR_YELLOW,     efeito = 1000}, -- ## [valor da storage] ## --
 [3] = {  Effect = 123, Storage = 259005, 3,  text = "Jounin",      color = COLOR_LIGHTGREEN, efeito = 999}, -- ## [valor da storage] ## --
 [4] = {  Effect = 123, Storage = 259005, 6,  text = "Akatsuki",    color = COLOR_DARKRED,    efeito = 2}, -- ## [valor da storage] ## --
 [5] = {  Effect = 123, Storage = 259005, 4,  text = "Anbu",        color = COLOR_WHITE,      efeito = 998},  -- ## [valor da storage] ## --
 [6] = {  Effect = 123, Storage = 959005, 5,  text = "Sannin",      color = COLOR_RED,        efeito = 995}, -- ## [valor da storage] ## --
 [7] = {  Effect = 123, Storage = 259005, 9,  text = "Kage",        color = COLOR_BLUE,        efeito = 2},  -- ## [valor da storage] ## --
 [8] = {  Effect = 123, Storage = 259005, 8,  text = "Hokage",      color = COLOR_RED,        efeito = 2}, -- ## [valor da storage] ## --
 [9] = {  Effect = 123, Storage = 259005, 10, text = "Otsutsuki",   color = COLOR_BLACK,        efeito = 2} -- ## [valor da storage] ## --
 
}

function onLogin(cid)
 for value, dados in pairs(tabela_infos) do
  if getPlayerStorageValue(cid, dados.Storage) == value then
     doSendMagicEffect(getPlayerPosition(cid), dados.efeito)
     doSendAnimatedText(getPlayerPosition(cid), dados.text, dados.color)
     end
    end
  return true
end 
 

 

6 horas atrás, Sun disse:

local tabela_infos = {
 [0] = {  Effect = 123, Storage = 259005,  text = "Shinobi",     color = COLOR_GREEN,      efeito = 1}, -- ## [valor da storage] ## --
 [1] = {  Effect = 123, Storage = 259005,  text = "Genin",       color = COLOR_DARKBROWN,  efeito = 2}, -- ## [valor da storage] ## --
 [2] = {  Effect = 123, Storage = 259005,  text = "Chunin",      color = COLOR_YELLOW,     efeito = 2}, -- ## [valor da storage] ## --
 [3] = {  Effect = 123, Storage = 259005,  text = "Jounin",      color = COLOR_LIGHTGREEN, efeito = 2}, -- ## [valor da storage] ## --
 [4] = {  Effect = 123, Storage = 259005,  text = "Akatsuki",    color = COLOR_DARKRED,    efeito = 2}, -- ## [valor da storage] ## --
 [5] = {  Effect = 123, Storage = 259005,  text = "Captao A.",   color = COLOR_WHITE,      efeito = 2},  -- ## [valor da storage] ## --
 [6] = {  Effect = 123, Storage = 259005,  text = "Anbu",        color = COLOR_RED,        efeito = 2}  -- ## [valor da storage] ## --
}

function onLogin(cid)
 for value, dados in pairs(tabela_infos) do
  if getPlayerStorageValue(cid, dados.Storage) == value then
	 doSendMagicEffect(getPlayerPosition(cid), dados.efeito)
	 doSendAnimatedText(getPlayerPosition(cid), dados.text, dados.color)
     end
    end
  return true
end 

 

agora em login.lua, cole isto acima do registerCreatureEvent


	if getPlayerStorageValue(cid, 259005) == -1 then
		setPlayerStorageValue(cid, 259005, 0)
	end

 

e agora junto com registerCreatureEvent cole isto.


registerCreatureEvent(cid, "efeito")

 

e agora em creaturescript.xml


<event type="login" name="efeito" event="script" value="efeito.lua"/>

 

 

Este gif é para lhe mostrar como ficou, eu já configurei tudo para você, não precisa alterar nada além de efeito e text.

OBS: O ISTO É APENAS UMA ILUSTRAÇÃO, OU SEJA SE O PLAYER LOGAR NÃO IRA TROCAR O TEXTO SE ELE TIVER COM O VALOR DE SHINOBI.

               efetio.thumb.gif.ef920f323c5a7a54c0296e6f6c753855.gif

 

@KR33

Perfeitoo Obrigado existe como colocar pro efeito sair em cima do player?

Tipo gostei aparece o texto mas junto ao texto o efeito que tenho no cliente ja confifurei no script ai.

Link para o post
Compartilhar em outros sites
4 horas atrás, 139 disse:

@KR33 editei o meu último comentário com o a correção do código, agora está funcionando 100%.
 

 

 

Muito obrigado deus abençoe vcs, mano to com uma ultima duvida no meu ot tem 8 sistemas eu so tenho 5 efeitos como fasso pra remover as linhas dos efeitos dos outros 3? tipo to tentando mais continua aparendo efeito.  TO FAZENDO ASSIM E NÃO SAIU TIPO QUERO Q ESSA LINHA NÃO SAIA EFEITO SO TEXTO TENDEU

Spoiler


 [9] = {  Effect = 123, Storage = 259005, 10, text = "Otsutsuki",   color = COLOR_BLACK }, -- ## [valor da storage] ## --

 

Link para o post
Compartilhar em outros sites
  • Moderador
1 hora atrás, KR33 disse:

 

 

Muito obrigado deus abençoe vcs, mano to com uma ultima duvida no meu ot tem 8 sistemas eu so tenho 5 efeitos como fasso pra remover as linhas dos efeitos dos outros 3? tipo to tentando mais continua aparendo efeito.  TO FAZENDO ASSIM E NÃO SAIU TIPO QUERO Q ESSA LINHA NÃO SAIA EFEITO SO TEXTO TENDEU

  Mostrar conteúdo oculto


 [9] = {  Effect = 123, Storage = 259005, 10, text = "Otsutsuki",   color = COLOR_BLACK }, -- ## [valor da storage] ## --

 

coloca o efeito 0

                                                                                                                  Have no idea!

                                                                                                  freelance? go to my discord:  sun#8860

 

Link para o post
Compartilhar em outros sites
  • 1 year later...
Em 17/03/2021 em 18:19, 139 disse:

Agora os erros estão explicados.  
Finalizei o script do Sun, colocando os efeitos pra saírem por 5 segundos e centralizados devidamente no char. 
 

  Ocultar conteúdo


local function sendEff(cid, eff, times)
	local center = getPlayerPosition(cid)
	local offset = {x = center.x+1, y = center.y, z = center.z}
	if times > 0 then
		if isCreature(cid) then
			doSendMagicEffect(offset, eff)
			addEvent(sendEff, 1000, cid, eff, times-1)
		end
	end
end

local tabela_infos = {
[0] = {Effect = 1, Storage = 259005,  text = "Shinobi",     color = COLOR_GREEN,      efeito = 1}, 
[1] = {Effect = 2, Storage = 259005,  text = "Genin",       color = COLOR_DARKBROWN,  efeito = 2}, 
[2] = {Effect = 3, Storage = 259005,  text = "Chunin",      color = COLOR_YELLOW,     efeito = 2},
[3] = {Effect = 4, Storage = 259005,  text = "Jounin",      color = COLOR_LIGHTGREEN, efeito = 2}, 
[4] = {Effect = 5, Storage = 259005,  text = "Akatsuki",    color = COLOR_DARKRED,    efeito = 2}, 
[5] = {Effect = 6, Storage = 259005,  text = "Captao A.",   color = COLOR_WHITE,      efeito = 2}, 
[6] = {Effect = 7, Storage = 259005,  text = "Anbu",        color = COLOR_RED,        efeito = 2},
}

function onLogin(cid)
	print("HEHEXD")
	for value, dados in pairs(tabela_infos) do
		if getPlayerStorageValue(cid, dados.Storage) == value then
			sendEff(cid, dados.efeito, 5) -- Repetir o efeito por 5 segundos.
			doSendAnimatedText(getPlayerPosition(cid), dados.text, dados.color)
		end
	end
	return true
end 

 

 

 

 

desculpa reviver mais consegue me ajudar por ela na otx? não funcionou na otc so na distro normal

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo