Postado Dezembro 30, 2012 12 anos [15:39:56.383] [Error - NpcScript Interface] [15:39:56.383] data/npc/scripts/arena.lua:onCreatureSay [15:39:56.383] Description: [15:39:56.383] data/npc/scripts/arena.lua:46: attempt to compare number with boolean [15:39:56.383] stack traceback: [15:39:56.383] data/npc/scripts/arena.lua:46: in function <data/npc/scripts/arena.lua:34> [15:39:56.383] [C]: in function 'selfSay' [15:39:56.383] data/npc/scripts/arena.lua:37: in function <data/npc/scripts/arena.lua:34> Script: Citar domodlib('arenaFunctions') 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 local focus = 0 local talk_start = 0 local TS = 0 function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end local function BYE() focus = 0 talk_start = 0 TS = 0 end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) then selfSay('Hello ' .. getCreatureName(cid) .. ', do you want to make arena?') focus = cid talk_start = os.clock() TS = 1 elseif msgcontains(msg, 'hi') and (focus ~= cid) then selfSay('Im Bussy') elseif TS == 1 and msgcontains(msg, 'yes') or msgcontains(msg, 'fight') or msgcontains(msg, 'arena') then if getPlayerStorageValue(cid, myArenaLevel) < 3 then local enterArena = myArenaLevelIs(cid) if getPlayerLevel(cid) >= enterArena.RLV then if getPlayerMoney(cid) >= enterArena.RC then setPlayerStorageValue(cid, talkNPC, 1) doPlayerRemoveMoney(cid, enterArena.RC) selfSay("Now you can go to test... ".. enterArena.LN .."!") BYE() else selfSay("You don\'t have "..enterArena.RC.." gp! Come back when you will be ready!") BYE() end else selfSay("You don\'t have "..enterArena.RLV.." level! Come back when you will be ready!") BYE() end else selfSay(Cancel[6]) BYE() end elseif TS == 1 and msgcontains(msg, 'no') then selfSay("Bye!") BYE() elseif msgcontains(msg, 'bye') then selfSay("Bye!") BYE() end return true end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 10 then if focus > 0 then selfSay('Good bye then.') end focus = 0 end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Dezembro 30, 2012 12 anos Tira os BBCODE. -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Dezembro 30, 2012 12 anos Posta aqui a lib domodlib('arenaFunctions') -"Supra Omnes Lux Lucis" - Acima de todos brilha a Luz -
Postado Dezembro 30, 2012 12 anos Autor Citar -- arena script InitArenaScript = 0 arena_room_max_time = 240 -- time in seconds for one arena room arenaKickPosition = {x=199, y=610, z=6} -- position where kick from arena when you leave/you did arena level arena_monsters = {} arena_monsters[42300] = 'frostfur' -- first monster from 1 arena arena_monsters[42301] = 'bloodpaw' arena_monsters[42302] = 'bovinus' arena_monsters[42303] = 'achad' arena_monsters[42304] = 'colerian the barbarian' arena_monsters[42305] = 'the hairy one' arena_monsters[42306] = 'axeitus headbanger' arena_monsters[42307] = 'rocky' arena_monsters[42308] = 'cursed gladiator' arena_monsters[42309] = 'orcus the cruel' arena_monsters[42310] = 'avalanche' -- first monster from 2 arena arena_monsters[42311] = 'kreebosh the exile' arena_monsters[42312] = 'the dark dancer' arena_monsters[42313] = 'the hag' arena_monsters[42314] = 'slim' arena_monsters[42315] = 'grimgor guteater' arena_monsters[42316] = 'drasilla' arena_monsters[42317] = 'spirit of earth' arena_monsters[42318] = 'spirit of water' arena_monsters[42319] = 'spirit of fire' arena_monsters[42320] = 'webster' -- first monster from 3 arena arena_monsters[42321] = 'darakan the executioner' arena_monsters[42322] = 'norgle glacierbeard' arena_monsters[42323] = 'the pit lord' arena_monsters[42324] = 'svoren the mad' arena_monsters[42325] = 'the masked marauder' arena_monsters[42326] = 'gnorre chyllson' arena_monsters[42327] = "fallen mooh'tah master ghar" arena_monsters[42328] = 'deathbringer' arena_monsters[42329] = 'the obliverator' function getArenaMonsterIdByName(name) name = string.lower(tostring(name)) for i = 42300, 42329 do if tostring(arena_monsters) == name then return i end end return 0 end
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.