Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

@Sttorm Ta dando o seguinte erro :                      [22/5/2018 1:32:7] [Error - LuaInterface::loadFile] data/npc/scripts/drunk rat.lua:27: unexpected symbol near 'ï'
                                                                                       [22/5/2018 1:32:7] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/drunk rat.lua
                                                                                       [22/5/2018 1:32:7] data/npc/scripts/drunk rat.lua:27: unexpected symbol near 'ï'"

  • Respostas 15
  • Visualizações 732
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • "You started the task" =  Você já iniciou a missão , ou seja, está correto. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(

  • Bom , vou compartilhar com você uma gambiarra que fiz aqui a um tempo atras , você vai perceber que é velho pelas gambiarras e identação do código , aqui vamos nós : NPCS   XML <?xml

Posted Images

Postado
5 minutos atrás, Zazeros disse:

@Sttorm Ta dando o seguinte erro :                      [22/5/2018 1:32:7] [Error - LuaInterface::loadFile] data/npc/scripts/drunk rat.lua:27: unexpected symbol near 'ï'
                                                                                       [22/5/2018 1:32:7] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/drunk rat.lua
                                                                                       [22/5/2018 1:32:7] data/npc/scripts/drunk rat.lua:27: unexpected symbol near 'ï'"

Tem um simbolo na linha 27 , retire porque você está copiando e colando a script errado , ou se preferir faça o DOWNLOAD da script task.lua

Postado
  • Autor
20 horas atrás, Sttorm disse:

Bom , vou compartilhar com você uma gambiarra que fiz aqui a um tempo atras , você vai perceber que é velho pelas gambiarras e identação do código , aqui vamos nós :

NPCS

 

XML


<?xml version="1.0" encoding="UTF-8"?>
<npc name="Tasker" script="data/npc/scripts/task/task.lua" walkinterval="2000" speed="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="167" head="38" body="79" legs="107" feet="114"/>
	<parameters>
  <parameter key="message_greet" value="I' have a task for you. [{accept}] or [{premio}] "/>
    </parameters></npc>

SCRIPT


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
 return false
end
 
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid


local storage = 35678 -- monster kill      |
local sto = 24529 -- don't pick premio     |
                                      --   | Não mecha nessa gambiarra aqui , só certifique que nenhuma dessas storages sejam usadas em outros sistemas
local rage = 24525 -- inicializate contage |
local ok = 45651 -- don't inicializate     |

local exp = 100   -- Quantidade de XP
local monster = 100 -- Quantos monstros terá que matar
local outfit = {

male = 10,  -- ID da outfit male
female = 11 -- ID da outfit female

}


if(msgcontains(msg, 'premio')) then
 if getPlayerStorageValue(cid, sto) == -1 then
  if getPlayerStorageValue(cid, storage) >= 100 then
  
  selfSay("You have finished the task", cid)
  doPlayerAddExp(cid, exp)
  doSendMagicEffect(getCreaturePosition(cid), 5)
  setPlayerStorageValue(cid, rage, -1)
  setPlayerStorageValue(cid, sto, 1)
  setPlayerStorageValue(cid, fuck, 1)
  
                             if getPlayerSex(cid) == 1 then
                                doPlayerAddOutfit(cid, outfit.male, 0)
                             else
                                doPlayerAddOutfit(cid, outfit.female, 0)
                             end 
  
  else
  selfSay("You need kill 100 monsters do finish the task", cid)
  end
 else
 selfSay("back from here nigga", cid)
 end
end

if(msgcontains(msg, 'accept')) then 
 if getPlayerStorageValue(cid, ok) == -1 then
   
   selfSay("You have intialized the task", cid)
   setPlayerStorageValue(cid, ok, 1)
   setPlayerStorageValue(cid, rage, 1)
   
 else
  selfSay("You started the task", cid)
end
end
end


 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

CREATURESCRIPTS

XML


<event type="death" name="task" event="script" value="task.lua"/>

Na XML do monstro


    <script>
    <event name="task"/>
    </script>

Script


local key = 35678
local rage = 24525 -- inicializate contage
local monster = 100 -- Quantos monstros terá que matar
 

function onDeath(cid, corpse, deathList)

local killer = deathList[1]

if not isPlayer(killer) then

return true

end

if getPlayerStorageValue(killer, rage) == -1 then

return true

end  
 

setPlayerStorageValue(killer, key, getPlayerStorageValue(killer, key) + 1)

doPlayerSendTextMessage(killer, 27, "Monster:: [".. getPlayerStorageValue(killer, key) .."//".. monster .."]")

return true

end

 

@Sttorm
Aqui Não esta funcionando, esta crashando o tibia e fechando

Obs: Já tentei mudar de toda as formas na parte

 

Citar

local outfit = {

male = 149, 
female = 145

 

E a Parte:
 

Citar

                             if getPlayerSex(cid) == 1 then
                                doPlayerAddOutfit(cid, outfit.male, 0)
                             else
                                doPlayerAddOutfit(cid, outfit.female, 1)
                             end 


Tentei colocar os ID que esta na pasta do XML Outfit, entre outras tentativas e todas resultaram no crash

Segue o Erro:

 

Spoiler

image.png.0e6bfce917d70b13927b391992573a85.png

 

Postado
  • Autor
6 minutos atrás, Sttorm disse:

@peterson18 Se você observar bem , na penúltima linha desse erro , olhe a tradução


Outfit has not all four directions = Outfit não tem todas as quatro direções

Tente colocar outra outfit e veja se funciona. 

Mas, essas são as outfit normal do servidor não tem outfith editada, logo não entendo o motivo do erro/crash...
@Sttorm
Entendi o erro... No XML que você passou você colocou o Loocktype no NPC 167, um Type que não existe no server ou seja, não é a script e sim o NPC que esta crashando.... Irei mudar e testar....

Editado por peterson18 (veja o histórico de edições)

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo