Postado Março 17, 2021 4 anos 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. @KR33
Postado Março 17, 2021 4 anos 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 = 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 Março 18, 2021 4 anos por 139 Agora ta funcionando certinho. (veja o histórico de edições)
Postado Março 18, 2021 4 anos Autor Em 17/03/2021 em 21: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. Mostrar conteúdo oculto 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. 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 = "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 Em 17/03/2021 em 20:51, 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. @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.
Postado Março 18, 2021 4 anos @KR33 editei o meu último comentário com o a correção do código, agora está funcionando 100%.
Postado Março 18, 2021 4 anos Autor Em 18/03/2021 em 06:30, 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 Mostrar conteúdo oculto [9] = { Effect = 123, Storage = 259005, 10, text = "Otsutsuki", color = COLOR_BLACK }, -- ## [valor da storage] ## --
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.