Postado Abril 12, 2012 13 anos -- utevorex.lua local configs = { vocs = {3, 7}, -- vocações permitidas usar limite = 2, -- limite de summons m = { ["70-200"] = {monster = "Wolf", health = 1000, mana=500}, ["201-300"] = {monster = "War Wolf", health = 1000, mana=500}, ["301-400"] = {monster = "Werewolf", health = 1000, mana=500}, } } -- [dolevel-atéolevel] = {nome do monstros, vida dele, e mana usada pra sumonar} function onSay(cid, words) if isInArray(configs.vocs, getPlayerVocation(cid)) then local tsummon = getTable(cid) if tsummon ~= nil then if getPlayerMana(cid) < tsummon.mana then return doPlayerSendCancel(cid, "You dont have mana.") end if #getCreatureSummons(cid) == configs.limite then return doPlayerSendCancel(cid, "You have reached the limit of summons.") end sm = doSummonCreature(tsummon.monster, getThingPosition(cid)) doConvinceCreature(cid, sm) setCreatureMaxHealth(sm, tsummon.health) doCreatureAddHealth(sm, tsummon.health) doCreatureAddMana(cid, -tsummon.mana) else doPlayerSendCancel(cid, "You dont have level to use this spell.") end else doPlayerSendCancel(cid, "Your vocation can not use this spell.") end return true end function getTable(cid) for i, x in pairs(configs.m) do local tb = string.explode(i) if getPlayerLevel(cid) >= tonumber(tb[1]) and getPlayerLevel(cid) <= tonumber(tb[2]) then tab = x end end return tab end -- tag: <talkaction words="utevo rex" filter="word-spaced" event="script" value="utevorex.lua"/> ___________________________________________________________________________________________________________________________________ Como Instalar esse esse script ,tive duvidas se é em talkactions ou spells .eu queria ele em spells se alguém pode me ajudar .
Postado Abril 12, 2012 13 anos Olá amigo, é nas talkactions. Você deve criar o arquivo lua chamado utevorex e botar o primeiro code lá. Depois ir em talkactions.xml e adicionar a tag.
Postado Abril 12, 2012 13 anos Autor Eu fiz isso mas da erro . Tipo o player fala mais não acontece nada e aprece um erro no console.
Postado Abril 12, 2012 13 anos @ridrid Seria bom se você postasse o erro, não podemos adivinhar, você não chega para um doutor e diz somente: Doutor estou doente, ele tem que saber os sintomas.
Postado Abril 12, 2012 13 anos Autor @MaxWellden Ok, Me Desculpe , [12/04/2012 15:10:01] [Error - TalkAction Interface] [12/04/2012 15:10:01] data/talkactions/scripts/utevorex.lua:onSay [12/04/2012 15:10:01] Description: [12/04/2012 15:10:01] data/talkactions/scripts/utevorex.lua:41: attempt to compare nil with number [12/04/2012 15:10:01] stack traceback: [12/04/2012 15:10:01] data/talkactions/scripts/utevorex.lua:41: in function 'getTable' [12/04/2012 15:10:01] data/talkactions/scripts/utevorex.lua:16: in function <data/talkactions/scripts/utevorex.lua:14> ---------------------- Só pra consta o final do meu nome é com c .
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.