Ir para conteúdo

Featured Replies

Postado

Olá galera, estou com erro em um script que muda a cor do outfit de um determinado player. O script funciona e não dá nenhum erro, até o momento em que eu logo no char para testar. 
 
Erro no distro:

  Citar

[20/01/2015 16:41:45] Lua Script Error: [CreatureScript Interface] 
[20/01/2015 16:41:45] in a timer event called from: 
[20/01/2015 16:41:45] data/creaturescripts/scripts/diablo skill.lua:onLogin
 
[20/01/2015 16:41:45] luaAddEvent(). callback parameter should be a function.

 
Script:

Mostrar conteúdo oculto

local function changex(cid, outift)



doCreatureChangeOutfit(cid, {lookType = outift.a, lookHead = (outift.b + 19), lookBody = (outift.c + 19), lookLegs = (outift.d + 19), lookFeet = (outift.e + 19), lookTypeEx = outift.f, lookAddons = outift.g})

if not isPlayer(cid) then
stopEvent(changey)
stopEvent(changex)
end

end
---------------------------------------------------
local function changey(cid, outift)

doCreatureChangeOutfit(cid, {lookType = outift.a, lookHead = (outift.b - 19), lookBody = (outift.c - 19), lookLegs = (outift.d - 19), lookFeet = (outift.e - 19), lookTypeEx = outift.f, lookAddons = outift.g})

if not isPlayer(cid) then
stopEvent(changey)
stopEvent(changex)
else
addEvent(trans, 50, cid, outift)
end

end
---------------------------------------------------------
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
doPlayerSetLossPercent(cid, i, getConfigValue('deathLostPercent'))
end
end

if getPlayerGroupId(cid) >= 3 and isPlayer(cid) then
local tempo = 2.5 --- de quanto em quanto segundos ele solta o efeito
function loop (cid)
local pos = getPlayerPosition (cid)
local outift = {
a = getCreatureOutfit(cid).lookType,
b = getCreatureOutfit(cid).lookHead,
c = getCreatureOutfit(cid).lookBody,
d = getCreatureOutfit(cid).lookLegs,
e = getCreatureOutfit(cid).lookFeet,
f = getCreatureOutfit(cid).lookTypeEx,
g = getCreatureOutfit(cid).lookAddons
}

addEvent(changex, 50, cid, outift)
addEvent(changey, 50, cid, outift)
addEvent(function()
if isPlayer(cid) then
loop(cid)
end
end, 3.0 * tempo * 450)
return true
end
loop(cid)
end
return TRUE
end

 

 

 

                                                                                                230x230.jpg

 

  • Respostas 16
  • Visualizações 904
  • Created
  • Última resposta

Top Posters In This Topic

Postado

que versão e esse evento ??? achei estranho da apra fazer ele mais facil de mecher lo.,.


o problema ta em nao encontrar oque o addEvent vai criar  tipo aquele Trans (nao tem oq significa ele)  e a função changex e y para que ficar daquele jeito.

Postado
  • Autor

Meu Tfs é versão 0.3.1

Se você puder ou quiser fazer do jeito mais fácil, não há problema algum.

Obrigado :D

                                                                                                230x230.jpg

 

Postado

acho que achei seu erro ta lem baixo

 

addEvent(function()

 

 

nao ta fechando tipo 

addEvent(function() )

remove a linha acima

 

acho q nao vai interfirir em nada.

Postado
  • Autor
  Citar

 

[20/01/2015 20:42:25] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/diablo skill.lua

[20/01/2015 20:42:25] data/creaturescripts/scripts/diablo skill.lua:52: unexpected symbol near ','

 

Acho que interfere '-' 

                                                                                                230x230.jpg

 

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo