
Solutions
-
Wakon's post in (Resolvido)Colocar exausted para usar esse item (action) was marked as the answerTenta assim:
function onUse(cid, item, fromPosition, itemEx, toPosition) local storExaust = 34455 local pos = fromPosition local aqui = getPlayerPosition(cid) local vocs = {240, 241, 242, 243, 244, 245, 246} local agua = {708,709,710,11,4610, 4612, 4611, 4664, 4613, 4666, 4646, 4654, 4609, 4665, 4608, 4625, 4665, 4666, 4645, 599, 601, 598, 600} local parede = {1840, 1055, 1056, 1058, 101060, 1061, 1062, 1063, 1064, 1067, 1834, 1030, 1029, 1025, 1026, 1027, 1259, 1028, 1029, 1032, 1034, 1033, 1536, 6850, 7028, 6843, 6853, 6850, 9062, 7027, 1533, 873, 919, 874, 1037, 2700, 2708, 4472, 4475, 4471, 3388, 3373, 3363, 3398, 3408, 3417, 3420, 3407, 3368, 2701, 5130, 6170, 6166, 1596, 3361, 3362, 3363, 3364, 3365, 3366, 3367, 3368, 3369, 3370, 3371, 3372, 3373, 3374, 3375, 3376, 3377, 3378, 3379, 3380, 3381, 3382, 3383, 3384, 3385, 3386, 3387, 3388, 3389, 3390, 3391, 3392, 3393, 3394, 3395, 3396, 3397, 3398, 3399, 3400, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422} local pedra = {874, 919, 873, 2707, 2784, 2778, 3330, 4471, 4475, 4473, 4472, 4474, 4468, 4478, 4469, 4470, 4479, 2703, 2704, 1534, 2739, 3867, 5324, 5316, 5315, 5317, 1600, 1597, 1601} if getDistanceBetween(aqui, toPosition) >= 8 then return doPlayerSendTextMessage(cid, 27, "Está muito longe.") elseif(not(isSightClear(aqui, toPosition, 1))) then return doPlayerSendTextMessage(cid, 27, "Isso é impossivel.") elseif(getTilePzInfo(aqui)) then return doPlayerSendCancel(cid, "Não pode usar a tecnica Deus Dragão em casas ou areas protegidas.") elseif(getTilePzInfo(toPosition)) then return doPlayerSendCancel(cid, "Não pode usar a tecnica Deus Dragão em casas ou areas protegidas.") elseif(isInArray(agua, itemEx.itemid)) then return doPlayerSendTextMessage(cid, 27, "voce nao pode usar em agua") elseif(isInArray(parede, itemEx.itemid)) then return doPlayerSendTextMessage(cid, 27, "voce nao pode usar em paredes") elseif(isInArray(pedra, itemEx.itemid)) then return doPlayerSendTextMessage(cid, 27, "voce nao pode usar em pedras") elseif(not(isInArray(vocs, getPlayerVocation(cid)))) then return doPlayerSendTextMessage(cid, 27, "Desculpe, Apenas Minato pode usar a tecnica Deus Dragão.") elseif(isCreature(itemEx.uid)) then return doPlayerSendTextMessage(cid, 27, "Desculpe, mas você não pode teletransportar em criaturas.") end if getPlayerStorageValue(cid, storExaust) < os.time() then if(doTeleportThing(cid, toPosition, false)) then doSendMagicEffect(pos, 14) doSendMagicEffect(toPosition, 14) doCreatureSay(cid, "Shunshin", 19) setPlayerStorageValue(cid, storExaust, 2 + os.time()) return doSendDistanceShoot(pos, toPosition, 0) end else doPlayerSendTextMessage(cid, 27, 'Aguarde 2 segundos para usar novamente.') end return doPlayerSendCancel(cid, "Desculpe nao foi possivel.") end -
Wakon's post in (Resolvido)Erro no script was marked as the answerTente assim:
local config = { teleportId = 1387, days = { ["Monday"] = {{x = 33649, y = 31261, z = 11}, {x = 33641, y = 31233, z = 11}}, -- tanjissegunda ["Wednesday"] = {{x = 33649, y = 31261, z = 11}, {x = 33641, y = 31233, z = 11}}, -- tanjisquarta ["Thursday"] = {{x = 33649, y = 31261, z = 11},{x = 33641, y = 31233, z = 11}}, -- tanjisquinta ["Tuesday"] = {{x = 33438, y = 31248, z = 11}, {x = 33421, y = 31254, z = 11}}, -- obujosterca ["Sunday"] = {{x = 33438, y = 31248, z = 11}, {x = 33421, y = 31254, z = 11}}, -- obujosdomingo ["Friday"] = {{x = 33557, y = 31281, z = 11}, {x = 33544, y = 31262, z = 11}}, -- jaulsexta } } function onStartup(interval) local i = config.days[os.date("%A")] if i then doCreateTeleport(config.teleportId, i[2], i[1]) end end -
Wakon's post in (Resolvido)Promotion para free accounts!(King Tbianus) was marked as the answerTenta assim:
-
Wakon's post in (Resolvido)Clicar no item trocar vocation was marked as the answerAqui está:
local t = { checkStorage = 0092, -- Não altere mesmo que faça outro script para outra vocation!!! vocStorage = 0091, -- Mesma coisa da checkStorage. maxLevel = 10, -- Level máximo para usar. table = { [2456] = {voc = 6}, [2457] = {voc = 7}, [2458] = {voc = 8} }, } function onUse(cid, item) for k, v in pairs(t.table) do if item.itemid == k then if getPlayerLevel(cid) <= t.maxLevel then doPlayerSetVocation(cid, v.voc) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua vocação foi alterada para ".. (getVocationInfo(v.voc).name) ..".") setPlayerStorageValue(cid, t.vocStorage, v.voc) setPlayerStorageValue(cid, t.checkStorage, 1) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores com level inferior a ".. t.maxLevel .." podem utilizar este item.") end end end return true end <action itemid="2456;2457;2458" event="script" value="changeVoc.lua"/> Adicione os itens no script e na tag, como no exemplo.
O creaturescripts, use o mesmo!
-
Wakon's post in (Resolvido)NPC Travel TFS 1.0 was marked as the answerTenta assim:
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 cfg = { toPos = {x=964, y=1025, z=14}, level = 1, Storage = 25747, temploPos = {x = 444, y = 444, z = 7} } 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 player = Player(cid) if msgcontains(msg, 'bosses') then selfSay('There are some undead below, you agree to be teleported there?', cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then if player:getStorageValue(cfg.Storage) > 0 then selfSay('You\'ve done it.', cid) return FALSE end if getPlayerLevel(cid) >= cfg.level then doTeleportThing(cid, cfg.toPos) talkState[talkUser] = 0 else selfSay('Only players level ' ..cfg.level.. ' can pass.', cid) end end if msgcontains(msg, 'no') and talkState[talkUser] == 1 then selfSay('Okay, you\'re a smart and probably know the face of danger that exists there.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'back') then doTeleportThing(cid, cfg.temploPos) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
Wakon's post in (Resolvido)ESTOU COM ESSE ERRO NO SCRIPT was marked as the answerQuase todas as funções estão erradas, arrumei as funções, testa ai:
-
Wakon's post in (Resolvido)Ajuda nesse NPC was marked as the answerFiz um aqui pra você, veja se lhe serve:
local t = { storage = 60080, -- Storage. reward = {5908, 1}, -- Reward e quantia. (Só funciona com agrupavel!) ineed = {5944, 2} -- Item necessário e quantia. } 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 msg = msg:lower(); local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'help') then if getPlayerStorageValue(cid, t.storage) <= 0 then selfSay('Meu irmao que se perdeu, pode encontra-lo e trazer alguma informaçao para mim?', cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, t.storage) == 2 then selfSay('Obrigado, mas você já me ajudou.', cid) elseif getPlayerStorageValue(cid, t.storage) == 1 then selfSay('Voce trouxe alguma informaçao dele?', cid) talkState[talkUser] = 2 end elseif msgcontains(msg, 'yes') then if talkState[talkUser] == 1 then selfSay('Obrigada, você estará fazendo um grande favor.', cid) setPlayerStorageValue(cid, t.storage, 1) talkState[talkUser] = 0 elseif talkState[talkUser] == 2 then if getPlayerStorageValue(cid, t.storage) == 1 then if doPlayerRemoveItem(cid, t.ineed[1], t.ineed[2]) then selfSay('Obrigado, ja fazia ideia de que isso iria acontecer. Pegue isso em forma de gratidao!', cid) doPlayerAddItem(cid, t.reward[1], t.reward[2]) setPlayerStorageValue(cid, t.storage, 2) talkState[talkUser] = 0 else selfSay('Você não tem nada sobre meu irmão, não brinque comigo!', cid) talkState[talkUser] = 0 end else selfSay('Obrigado, mas você já me ajudou.', cid) talkState[talkUser] = 0 end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) -
Wakon's post in (Resolvido){Pedido} Tile para castle24h was marked as the answerTestei agora e está funcionando:
function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end local g_storage = getGlobalStorageValue(123123) if g_storage ~= getPlayerGuildId(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você foi teleportado ao templo, parece que outra guild dominou o castelo.") end end Se der problema, avise.
-
Wakon's post in (Resolvido)[DUVIDA] TÍTULO DO CLIENTE OTSERVER was marked as the answerBaixe o XVI32 e siga os passos abaixo.
1 - Clique em File>Open... e seleciona o seu cliente.
2 - Aperte CTRL+F, selecione Text string e digite "Tibia".
3 - Aperte a tecla Insert do teclado e digite por cima da palavra o nome do seu servidor, o título pode ter no máximo 7 letras.
Você pode ir alterando e procurando o certo, faça o processo, salve e teste, caso não funcione basta digitar Tibia no lugar.
Lembre-se, não delete NADA com backspace, se quiser deixar algo em branco, utilizando a tecla Insert aperte a barra de espaço.
-
Wakon's post in (Resolvido)Onde mudo o locar que o player aparece enquanto esta criando conta was marked as the answerAbre sua database, vá em Players, selecione o account manager e altere a posição dele.
O tópico foi movido para a área correta, preste mais atenção da próxima vez!
Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680
Este tópico foi movido:
De: "OTServ → Scripting → Geral"
Para: "OTServ → Suporte OTServ → Suporte de OTServ Geral"
-
Wakon's post in (Resolvido)NPC para entrega de itens was marked as the answerNão está muito bom, mas acho que vai lhe servir.
Em "Data/npc/scripts", anciao.lua:
Em "Data/npc", anciao.xml:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Anciao" script="data/npc/scripts/anciao.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="309" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Em que posso lhe ajudar?"/> </parameters> </npc> -
Wakon's post in (Resolvido)Sistema !b com a mesma função de /b pagando 100K p/ players was marked as the answerEm "Data/talkactions/scripts", broadcastPlayer.lua:
local t = { coolDown = 5, -- Tempo para usar novamente em minutos. storage = 59555, -- Só mexa se necessário. level = 100, -- Level necessário. price = 100000 -- Preço para usar. } function onSay(cid, words, param) local message = getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]: " .. param if param == '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite sua mensagem.") return true end if getPlayerStorageValue(cid, t.storage) - os.time() >= 1 then doPlayerSendCancel(cid, "Você precisa esperar ".. math.ceil((getPlayerStorageValue(cid, t.storage) - os.time())/60) .." minuto(s) para usar novamente.") return true end if getPlayerLevel(cid) >= t.level then if doPlayerRemoveMoney(cid, t.price) then setPlayerStorageValue(cid, t.storage, t.coolDown * 60 + os.time()) doBroadcastMessage(message, MESSAGE_EVENT_ADVANCE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Mensagem enviada..") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de ".. t.price .." gold coins para utilizar este comando.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ser level ".. t.level .." para utilizar este comando.") end return true end Em "Data/talkactions", no arquivo talkactions.xml:
<talkaction words="!message" event="script" value="broadcastPlayer.lua"/> Caso dê algum problema, me avise.
-
Wakon's post in (Resolvido)Script Puxe All - Narutiba 8.54 was marked as the answerEm "Data/globalevents/scripts", pushAll.lua:
local t = { timePush = "15:30", msg = "Todos os players foram puxados á sala.", pos = {x = 160, y = 54, z = 7} } function onThink(interval, lastExecution) hours = tostring(os.date("%X")):sub(1, 5) for _, pid in ipairs(getPlayersOnline()) do if hours == t.timePush then doTeleportThing(pid, t.pos) doBroadcastMessage(t.msg) end end return true end Em "Data/globalevents", no arquivo globalevents.xml:
<globalevent name="pushAll" interval="60" event="script" value="pushAll.lua"/> Caso dê bug e fique executando varias vezes, altere o interval para 60000.
-
Wakon's post in (Resolvido)Como colocar potion infinito 10.76 was marked as the answerVai em "Data/actions/scripts/others", abre o arquivo potions.lua e remove as linhas:
Item(item.uid):remove(1) doPlayerAddItem(cid,potion.emptyId, 1) -
Wakon's post in (Resolvido)Como Fazer Evento Boss was marked as the answerEm "Data/talkactions/scripts", bossEvent.lua:
local t = { msgActive = "Preparem-se ninjas de Konoha, Gakure está vindo para destruir a vila de Konoha.", msgSpawn = "Rapido ninjas, o boss está na frente do templo, protejam a vila.", coolDown = 5, -- Tempo para nascer após usar o comando. boss = "rat", -- Nome do boss. pos = {x = 157, y = 58, z = 7} -- Posição em que o boss irá nascer. } function onSay(cid, words) local function summonBoss() doSendMagicEffect(t.pos, CONST_ME_TELEPORT) doCreateMonster(t.boss, t.pos) doBroadcastMessage(t.msgSpawn) end doBroadcastMessage(t.msgActive) addEvent(summonBoss, t.coolDown * 60) return true end Em "Data/talkactions", no arquivo talkactions.xml:
<talkaction log="yes" words="/bossevent" access="5" event="script" value="bossEvent.lua"/> -
Wakon's post in (Resolvido)Como Criar Evento Por Comando was marked as the answerEm "Data/talkactions/scripts", copie dois arquivos.lua e renomei-os para enterevent.lua e openevent.lua, apague tudo neles e cole:
No arquivo enterevent.lua:
local t = { gStorage = 25252, -- Só mexa se necessário. msgoff = "O evento de backpack não está aberto no momento.", -- Mensagem caso não esteja aberto. effect = CONST_ME_TELEPORT, -- Efeito ao teleportar. pos = {x = 160, y = 54, z = 7} -- Posição que o comando irá levar. } function onSay(cid, words, param) if getGlobalStorageValue(t.gStorage) >= 1 then if getCreatureCondition(cid, CONDITION_INFIGHT) == false then if getTilePzInfo(getPlayerPosition(cid)) == true then doTeleportThing(cid, t.pos) doSendMagicEffect(getPlayerPosition(cid), t.effect) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vá até uma zona de proteção para usar o comando.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar o comando em batalha.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, t.msgoff) end return true end No arquivo openevent.lua:
local t = { gStorage = 25252, msgoff = "O evento de backpack terminou.", msg = "O evento backpack foi aberto, para entrar digite !evento em uma zona de proteção!" } function onSay(cid, words, param) if param == nil then return doPlayerSendCancel(cid, "Commands param required.") end if param == "open" then if getGlobalStorageValue(t.gStorage) <= 0 then setGlobalStorageValue(t.gStorage, 1) doBroadcastMessage(t.msg) else doPlayerSendCancel(cid, "O evento já está aberto.") end elseif param == "close" then if getGlobalStorageValue(t.gStorage) >= 1 then setGlobalStorageValue(t.gStorage, 0) doBroadcastMessage(t.msgoff) else doPlayerSendCancel(cid, "O evento não está aberto.") end end return true end Agora em "Data/talkactions", abra o arquivo talkactions.xml e adicione:
<talkaction words="!evento" event="script" value="enterevent.lua"/> <talkaction log="yes" words="/event" access="5" event="script" value="openevent.lua"/> Comandos: /event open | /event close | !evento
O tópico foi movido para a área correta, preste mais atenção da próxima vez!
Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680
Este tópico foi movido:
De: "OTServ → Scripting → Tutoriais de Scripting"
Para: "OTServ → Suporte OTServ → Suporte de Scripts"
-
Wakon's post in (Resolvido)[Pedido] NPC que vende itens em troca de diamond Poketibia was marked as the answerEm "Data/npc/scripts", arquivo.lua:
Em "Data/npc", nome_do_npc.xml:
Está configurado para Tibia, mas basta você modificar os id's/nomes ao seu gosto!
Créditos: Adriano SwaTT
-
Wakon's post in (Resolvido)NPC teleportar player was marked as the answerEm "Data/npc/scripts", monge.lua:
local t = { pos = {x = 160, y = 57, z = 7}, keys = {"travel", "sail", "teleport"} } 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 msg = msg:lower(); local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if isInArray(t.keys, msg) then selfSay("Deseja ir até LOCAL?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") then if talkState[talkUser] == 1 then doTeleportThing(cid, t.pos) end elseif msgcontains(msg, "no") then if talkState[talkUser] == 1 then selfSay('Ok, até mais.', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Em "Data/npc", monge.xml:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Monge" script="data/npc/scripts/traveltwo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="300" head="57" body="59" legs="40" feet="76" addons="0"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Posso te levar até LOCAL, diga {travel}."/> </parameters> </npc> -
Wakon's post in (Resolvido)Problema com Dat Editor (Sprites que e exportada n abri) was marked as the answerUsa o Object Builder é bem mais fácil de mexer e tem menos chances de dar erros.
-
Wakon's post in (Resolvido)Problema com servidor was marked as the answer"Se for TFS 1.x, já mudou o account type para 5?"
-
Wakon's post in (Resolvido)(Ajuda) Mudar mensagem was marked as the answerdoBroadcastMessage não funciona com "cid", teria que ser doPlayerBroadcastMessage e acho que não dá para colocar no default com broadcast.
Veja se é assim que você quer:
function onUse(cid, item) local price = 1000000 -- Preço do item local it = 7435 -- ID do item local count = 1 -- Quantia do item if not doPlayerRemoveMoney(cid, price) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa ter (1kk) para comprar "..count.."x "..getItemNameById(it)..".") return true end doPlayerAddItem(cid, it, count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você comprou "..count.."x "..getItemNameById(it).." por 1kk.") return true end -
Wakon's post in (Resolvido)Aviso se está com bless ou não was marked as the answerhttp://www.tibiaking.com/forum/topic/60016-tfs-04036-aviso-de-bless-ao-sair-da-zona-de-prote%C3%A7%C3%A3o/
-
Wakon's post in (Resolvido)Runa não funciona was marked as the answerScript:
local healMana = {25000, 30000} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE) function onCastSpell(cid, var) doCreatureAddMana(cid, math.random(healMana[1], healMana[2])) doCreatureSay(cid,"Aaaah...", TALKTYPE_ORANGE_1) return doCombat(cid, combat, var) end TAG:
<rune name="Mana Rune" id="2276" allowfaruse="1" charges="1" lvl="15000" maglv="1" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/WR.lua"/> -
Wakon's post in (Resolvido)Quando o pokemon morre n abre portal was marked as the answerEm "Data/creaturescripts/scripts", copie e cole um arquivo.lua e renomeie para deathTP.lua, apague tudo e cole:
local t = { tpId = 1387, -- ID do teleport. tpNew = {x = 1057, y = 1057, z = 7}, -- Local onde irá aparecer o teleport. tpPos = {x = 1059, y = 1059, z = 7}, -- Local para onde o teleport irá levar. monster = "rattata", -- Nome do monstro(pokémon/normal), coloque em letra minúscula. timeRemove = 5 -- Tempo para remover o teleport em segundos. } function onKill(cid, target) local function removeTeleport(position) position.stackpos = 1 if (getThingfromPos(position).itemid == t.tpId) then doRemoveItem(getThingfromPos(position).uid) doSendMagicEffect(t.tpNew, 13) end return true end if (ehMonstro(target) and string.lower(getCreatureName(target)) == t.monster) then doCreateTeleport(t.tpId, t.tpPos, t.tpNew) doCreatureSay(target, "Você tem ".. t.timeRemove .." segundos para entrar no teleport.", TALKTYPE_ORANGE_1, 0, 0, t.tpNew) addEvent(removeTeleport, t.timeRemove * 1000, t.tpNew) end return true end Agora em "Data/creaturescripts", abra o arquivo creaturescripts.xml e adicione a tag:
<event type="kill" name="deathTP" script="deathTP.lua"/> Novamente em "Data/creaturescripts/scripts", abra o arquivo login.lua e registre:
registerCreatureEvent(cid, "deathTP") Configure ao seu gosto, se der algum problema, me avise!
-
Wakon's post in (Resolvido)[AJUDA] Script capreset was marked as the answerlocal t = { level = 10, pz = true, battle = true } function onSay(cid, words) if t.pz == true and getTilePzInfo(getCreaturePosition(cid)) == false then doPlayerSendCancel(cid, "Você não pode usar fora da zona de proteção.") return true end if t.battle == true and getCreatureCondition(cid, CONDITION_INFIGHT) == true then doPlayerSendCancel(cid, "Você não pode utilizar em batalha.") return true end if getPlayerLevel(cid) >= t.level then doPlayerSetMaxCapacity(cid, 1000) doRemoveCreature(cid) else doPlayerSendCancel(cid, "Você não pode utilizar este comando!") end return true end