Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Primeiramente quero dizer que so postei em geral por que em npc não tem opção de postar.

 

Tem um erro que aparece na minha distro de um npc que não da load.

erro na distro  tfs 1.2

[Warning - NpcScript::NpcScript] Can not load script: dicer.lua

data/npc/scripts/dicer.lua:5: function arguments expected near ':'

 

 

script do npc.lua

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
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()
 
function onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end
 
local function delayMoneyRemoval(delayRemovedItem)
delayRemovedItem:remove(delayRemovedItem:getCount())
end
 
local function placeMoney(amount, table_middle_pos)
local remain = amount
local crystal_coins = 0
local platinum_coins = 0
 
if (math.floor(amount / 10000) >= 1) then
crystal_coins = math.floor(amount / 10000)
remain = remain - crystal_coins * 10000
end
 
if ((remain / 100) >= 1) then
platinum_coins = remain / 100
end
 
addEvent(doCreateItem, 550, 2152, platinum_coins, table_middle_pos)
addEvent(doCreateItem, 600, 2160, crystal_coins, table_middle_pos)
end
 
local function rollDice(roll, cc_count, pc_count, table_left_pos, table_middle_pos, npc)
local dice_ids = {5792, 5793, 5794, 5795, 5796, 5797}
local random_rollval = math.random(1,6)
local total_g = (10000 * cc_count) + (100 * pc_count)
local prize_percent = 0.8 -- 80%
 
if ((total_g) <= 300000 and (total_g) >= 5000) then
table_left_pos:sendMagicEffect(CONST_ME_CRAPS)
 
for _, itemId in pairs(dice_ids) do
if(getTileItemById(table_left_pos, itemId).uid > 0) then
doTransformItem(getTileItemById(table_left_pos, itemId).uid, dice_ids[random_rollval])
end
end
 
if (roll == 1 and random_rollval <= 3) then
placeMoney(total_g + (total_g * prize_percent), table_middle_pos)
addEvent(Position.sendMagicEffect, 400, table_left_pos, CONST_ME_SOUND_GREEN)
addEvent(Position.sendMagicEffect, 700, table_left_pos, CONST_ME_SOUND_GREEN)
elseif (roll == 2 and random_rollval >= 4) then
placeMoney(total_g + (total_g * prize_percent), table_middle_pos)
addEvent(Position.sendMagicEffect, 400, table_left_pos, CONST_ME_SOUND_GREEN)
addEvent(Position.sendMagicEffect, 700, table_left_pos, CONST_ME_SOUND_GREEN)
else
addEvent(Position.sendMagicEffect, 400, table_left_pos, CONST_ME_BLOCKHIT)
addEvent(Position.sendMagicEffect, 700, table_left_pos, CONST_ME_BLOCKHIT)
end
 
npc:say(string.format("%s rolled a %d.", npc:getName(), random_rollval), TALKTYPE_ORANGE_1, false, 0, npc:getPosition())
 
else
addEvent(doCreateItem, 100, 2160, cc_count, table_middle_pos)
addEvent(doCreateItem, 150, 2152, pc_count, table_middle_pos)
npc:say("The minimum wager is 5K and the maximum wager is 300K.", TALKTYPE_SAY, false, 0, npc:getPosition())
end
 
return true
end
 
function creatureSayCallback(cid, type, msg)
-- NPC userdata instance
local npc = Npc(getNpcCid())
 
-- Participating player userdata instance
local position = npc:getPosition() + {x = 2, y = 0, z = 0}
position.stackpos = STACKPOS_TOP_CREATURE
local player_uid = getThingfromPos(position).uid
 
-- Game table position userdata instances
local table_left_pos = Position(1110, 994, 8)
local table_middle_pos = Position(1111, 994, 8)
 
-- Search for coins on the left and middle tables and create item userdata instances
local table_left_cc_uid = getTileItemById(table_left_pos, 2160).uid
local table_middle_cc_uid = getTileItemById(table_middle_pos, 2160).uid
local table_left_pc_uid = getTileItemById(table_left_pos, 2152).uid
local table_middle_pc_uid = getTileItemById(table_middle_pos, 2152).uid
 
-- Other variables
local cc_count = 0
local pc_count = 0
local ROLL, LOW, HIGH = 0, 1, 2
 
if (player_uid ~= 0) then
player = Player(player_uid)
if ((msgcontains(string.lower(msg), 'high') and (player:isPlayer() and player:getId() == cid)) then
ROLL = HIGH
elseif ((msgcontains(string.lower(msg), 'low') and (player:isPlayer() and player:getId() == cid)) then
ROLL = LOW
else
return false
end
 
if (table_middle_cc_uid ~= 0) then
table_middle_cc = Item(table_middle_cc_uid)
cc_count = table_middle_cc:getCount()
table_middle_cc:moveTo(table_left_pos)
addEvent(delayMoneyRemoval, 300, table_middle_cc)
end
 
if (table_middle_pc_uid ~= 0) then
table_middle_pc = Item(table_middle_pc_uid)
pc_count = table_middle_pc:getCount()
table_middle_pc:moveTo(table_left_pos)
addEvent(delayMoneyRemoval, 300, table_middle_pc)
end
addEvent(rollDice, 500, ROLL, cc_count, pc_count, table_left_pos, table_middle_pos, npc)
else
return false
end
 
return true
end
 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

 

Agradeço desde ja, se alguem puder me ajudar.

Editado por acesso123 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 4 weeks later...

Você não pode postar em NPC's, apenas na área de suporte, já lhe avisei sobre isso outras vezes.

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.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo