Postado Junho 23, 2017 7 anos Galera esse meu script funciona perfeitamente, ele deixa o texto subindo no jogador pelo tempo que eu botei e conforme o level tambem. Mas eu quero fazer uma alteração e ja tentei varias maneiras mas nao obtive sucesso, se vocês me ajudarem vou disponibilizar o script com 1 tutorial aqui no TK! - "400" é o level do Player, preciso adicionar outros level como por exemplo 400,500,600... tudo nesse script, tentei algumas maneiras e nao tive sucesso .... Alguem pode me ajudar a adicionar outros leveis ? OBS: EU achei esse script no TK que era pra subir VIP no player dai fiz as devidas modificações conforme queria. -SCRIPT: 8.60 local delay = 100 --Intervalo de tempo entre o efeito, em milésimos de segundo. local level = 400 function sendPlayerEffect(cid) if getPlayerLevel(cid) == level then doSendAnimatedText(getThingPos(cid), "[GOLD]", math.random(1, 255)) addEvent(sendPlayerEffect, delay * 100, cid) end end function onLogin(cid) sendPlayerEffect(cid) return true end
Postado Junho 23, 2017 7 anos --[[ Exemplo: local config = { [400] = {Text = "[GOLD]", TextColor = "random", Delay = 200}, [300] = {Text = "[MEU PAU COM SAL]", TextColor = "18", Delay = 200}, [200] = {Text = "[MEU PAU DE ÓCULOS]", TextColor = "180", Delay = 200}, } Sempre coloque o maior level por cima. 400 está acima de 300 por exemplo /\, e 300 acima de 200. Se o TextColor for dado como "random", será aleatória a cor. ]] local config = { [400] = {Text = "[GOLD]", TextColor = "random", Delay = 200}, } function sendPlayerEffect(cid) if isCreature(cid) then for k, v in pairs(config) do if getPlayerLevel(cid) >= k then doSendAnimatedText(getThingPos(cid), v.Text, string.lower(v.TextColor) == "random" and math.random(1, 255) or tonumber(v.TextColor)) addEvent(sendPlayerEffect, delay * 100, cid) end end end end function onLogin(cid) sendPlayerEffect(cid) return true end _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Junho 24, 2017 7 anos Autor Em 23/06/2017 em 19:23, Snowsz disse: --[[ Exemplo: local config = { [400] = {Text = "[GOLD]", TextColor = "random", Delay = 200}, [300] = {Text = "[MEU PAU COM SAL]", TextColor = "18", Delay = 200}, [200] = {Text = "[MEU PAU DE ÓCULOS]", TextColor = "180", Delay = 200}, } Sempre coloque o maior level por cima. 400 está acima de 300 por exemplo /\, e 300 acima de 200. Se o TextColor for dado como "random", será aleatória a cor. ]] local config = { [400] = {Text = "[GOLD]", TextColor = "random", Delay = 200}, } function sendPlayerEffect(cid) if isCreature(cid) then for k, v in pairs(config) do if getPlayerLevel(cid) >= k then doSendAnimatedText(getThingPos(cid), v.Text, string.lower(v.TextColor) == "random" and math.random(1, 255) or tonumber(v.TextColor)) addEvent(sendPlayerEffect, delay * 100, cid) end end end end function onLogin(cid) sendPlayerEffect(cid) return true end Maninho ta dando erros: [Error - CreatureScript Interface] [24/06/2017 15:10:27] data/creaturescripts/scripts/PlayerEffect.lua:onLogin [24/06/2017 15:10:27] Description: [24/06/2017 15:10:27] data/creaturescripts/scripts/PlayerEffect.lua:22: attempt to perform arithmetic on global 'delay' (a nil value) [24/06/2017 15:10:27] stack traceback: [24/06/2017 15:10:27] data/creaturescripts/scripts/PlayerEffect.lua:22: in function 'sendPlayerEffect' [24/06/2017 15:10:27] data/creaturescripts/scripts/PlayerEffect.lua:29: in function <data/creaturescripts/scripts/PlayerEffect.lua:28>
Postado Junho 25, 2017 7 anos @Pejo troca essa linha: addEvent(sendPlayerEffect, delay * 100, cid) por essa: addEvent(sendPlayerEffect, v.delay * 100, cid)
Postado Junho 26, 2017 7 anos Erro meu, mybad. --[[ Exemplo: local config = { [400] = {Text = "[GOLD]", TextColor = "random", Delay = 200}, [300] = {Text = "[MEU PAU COM SAL]", TextColor = "18", Delay = 200}, [200] = {Text = "[MEU PAU DE ÓCULOS]", TextColor = "180", Delay = 200}, } Sempre coloque o maior level por cima. 400 está acima de 300 por exemplo /\, e 300 acima de 200. Se o TextColor for dado como "random", será aleatória a cor. ]] local config = { [400] = {Text = "[GOLD]", TextColor = "random", Delay = 200}, } function sendPlayerEffect(cid) if isCreature(cid) then for k, v in pairs(config) do if getPlayerLevel(cid) >= k then doSendAnimatedText(getThingPos(cid), v.Text, string.lower(v.TextColor) == "random" and math.random(1, 255) or tonumber(v.TextColor)) addEvent(sendPlayerEffect, v.Delay * 100, cid) end end end end function onLogin(cid) sendPlayerEffect(cid) return true end _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
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.