Solutions
-
Storm's post in (Resolvido)Login.lua dando erro was marked as the answer@Rogex Joyz
-
Storm's post in (Resolvido)BUG Teleport Automatico was marked as the answer@victor4312
local config = { day = {"Monday", "Wednesday", "Friday", "Sunday"}, pos = {x=151, y=77, z=6}, topos = {x=550, y=34, z=7}, time = 5, -- tempo que o teleport ira sumir em minutos msg_open = "O Portal vai se abrir em 5 minutos.", msg_close = "O Portal se fechou." } local function DelTp() local t = getTileItemById(config.pos, 1387) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(config.pos, CONST_ME_POFF) end end function onTime() if isInArray(config.day, os.date("%A")) then doCreateTeleport(1387, config.topos, config.pos) doBroadcastMessage(config.msg_open) addEvent(DelTp, config.time*60*1000) addEvent(doBroadcastMessage, config.time*60*1000, config.msg_close) end return true end
-
Storm's post in (Resolvido)Exhausted em uma lever was marked as the answer@Rogex Joyz
Configure as posições que eu mostrei na imagem acima, nessa parte aqui:
area = { -- fromPos e toPos {x = 18, y = 60, z = 13}, {x = 21, y = 60, z = 13}, },
-
Storm's post in (Resolvido)Aumentar Charges was marked as the answer@Lisbeky
local config = { item = 2131, -- ID do item count = 1, -- Qnt de item que será removida charges = 1000, -- Charges remove = 9020, -- Item que será removido countr = 25, -- Qnt do item que será removida texto = "Você comprou star amulet. Custou 25 Tokens.", texto2 = "Tokens insuficientes. Precisa de 25 Tokens para comprar star amulet.", effect = 15 } function onUse(cid, item, fromPosition, itemEx, toPosition) if doPlayerRemoveItem(cid, config.remove, config.countr) then doPlayerSendTextMessage(cid, 22, config.texto) local item = doPlayerAddItem(cid, config.item, config.count) doItemSetAttribute(item, "charges", config.charges) doSendMagicEffect(fromPosition, config.effect) else doPlayerSendTextMessage(cid, 22, config.texto2) end return true end
-
Storm's post in (Resolvido)Fechem por favor. was marked as the answer@Camilo Salvadori É só passar o tile como um parâmetro da function emboscada, ficando assim:
addEvent(emboscada, 3000, cid.uid, position, tile) local function emboscada(cid, position, tile)
Com isso você pode remover essa linha da função emboscada
local tile = Item(item.uid)
-
Storm's post in (Resolvido)[Pedido] Script de tile por Outfit was marked as the answer@darkalvaro
local outfit = 211 -- Outfit para poder passar no tile function onStepIn(cid, item, position, fromPosition) if isPlayer(cid) then if getCreatureOutfit(cid).lookType ~= outfit then doTeleportThing(cid, fromPosition) doPlayerSendTextMessage(cid, 18, "Você não tem a outfit certa para passar no piso!") doSendMagicEffect(position, CONST_ME_POFF) end end return true end
-
Storm's post in (Resolvido)getItemAttribute retornando null was marked as the answer@Balkalima Tirei aquele print(type) e mudei algumas outras coisas, tenta ai:
function onGetFormulaValues(cid, level, skill, attack, factor) local arma = getPlayerSlotItem(cid, CONST_SLOT_LEFT) if getItemWeaponType(arma.uid) ~= 4 then local danoArma = getItemInfo(arma.itemid).attack else local danoArma = getItemInfo(getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid).attack end print(danoArma) -- print apenas para ver o que é retornado (null neste caso) min = -(((attack * 5) + (skill * 0.5) + (level * 0.04)) / factor) max = -(((attack * 5) + (skill * 0.8) + (level * 0.06)) / factor) return min, max end
-
Storm's post in (Resolvido)Check party item was marked as the answer@esnio12 Faz mais um for para remover todos os itens, se você não quiser remover na hora da verificação
for index, var2 in pairs(party_id) do doPlayerRemoveItem(var2, itemid, count) end
-
Storm's post in (Resolvido)Preciso de uma script was marked as the answer@Calisto
local config = { [1] = {item1 ={2150, 2, {x = 30, y = 30, z = 7, stackpos = 2}}, item2 = {2151, 3, {x = 30, y = 30, z = 7, stackpos = 255}}, chance = 50, result = {2160, 3, {x = 30, y = 30, z = 7, stackpos = 255}}}, [2] = {item1 ={2150, 2, {x = 30, y = 30, z = 7, stackpos = 2}}, item2 = {2151, 3, {x = 30, y = 30, z = 7, stackpos = 255}}, chance = 50, result = {2160, 3, {x = 30, y = 30, z = 7, stackpos = 255}}} } function onUse(cid, item, fromPosition, itemEx, toPosition) for _, var in pairs(config) do local item1 = getThingfromPos(var.item1[3]) local item2 = getThingfromPos(var.item2[3]) if item1.itemid == var.item1[1] and item2.itemid == var.item2[1] then if item1.type >= var.item1[2] and item2.type >= var.item2[2] then doRemoveItem(item1.uid, var.item1[2]) doRemoveItem(item2.uid, var.item2[2]) if math.random(1, 100) <= var.chance then doCreateItem(var.result[1], var.result[2], var.result[3]) doPlayerSendTextMessage(cid, 27, "Parabens! Você obteve sucesso na forja!") doSendAnimatedText(var.result[3], "Forjou!", 36) return true else doPlayerSendTextMessage(cid, 18, "Infelizmente a forja falhou!") return true end else doPlayerSendTextMessage(cid, 19, "Quantidade de itens insuficiente.") return true end end end return true end
-
Storm's post in (Resolvido)Mana Potion was marked as the answer@Jonathan005 Tenta assim:
-
Storm's post in (Resolvido)FOOD MAGICO was marked as the answer@Dr Mandrake Fiz de forma rápida aqui, testa aí pra ver se vai funfar:
local config = { effect = 3, -- Effect ao usar o item textType = 27, -- Tipo do Texto msg = "Mana Refilled." -- Texto que vai aparecer quando usar o item } function onUse(cid, item, fromPosition, itemEx, toPosition) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid, config.textType, config.msg) doSendMagicEffect(fromPosition, config.effect) return true end
Para o que enche a vida toda é a mesma coisa, só trocar a linha:
doCreatureAddMana(cid, getCreatureMaxMana(cid)) Para essa linha aqui:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
-
Storm's post in (Resolvido)Spell dando paralyze infinito was marked as the answer@MarkCharlotte Removi a condition, não faz nenhum sentido ter ela ali
-
Storm's post in (Resolvido)SCRIPT DE BOSS ALEATORIO was marked as the answer@Jonathan005 Não sou bom com TFS 1.X, mas tenta assim:
-
Storm's post in (Resolvido)[Resolvido] Efeito não sai na posição correta was marked as the answer@RuukasuSenpai Foi mal, lerdei demais agora:
local effects = { --Goku-- [915] = 672, } function onThink(interval) for _, pid in ipairs(getPlayersOnline()) do local effect = effects[getPlayerVocation(pid)] if(effect) then local position = {x = getCreaturePosition(pid).x, y = getCreaturePosition(pid).y, z = getCreaturePosition(pid).z} doSendMagicEffect(position, effect) end end return true end
-
Storm's post in (Resolvido)problema com QUEST/BAÚS was marked as the answer@kaique2020 Acho que essa script foi feita do jeito errado, tenta trocar o valor das storages deixando assim:
function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 5997 then queststatus = getPlayerStorageValue(cid, 33333) if queststatus < 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Royal Scale Robe.") doPlayerAddItem(cid, 12604, 1) setPlayerStorageValue(cid, 33333, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") end elseif item.uid == 5997 then queststatus = getPlayerStorageValue(cid, 33334) if queststatus < 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Royal Draken Mail.") doPlayerAddItem(cid, 12603, 1) setPlayerStorageValue(cid, 33334, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") end elseif item.uid == 5997 then queststatus = getPlayerStorageValue(cid, 33335) if queststatus < 1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Elite Draken Helmet.") doPlayerAddItem(cid, 12606, 1) setPlayerStorageValue(cid, 33335, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") end end return true end
@kaique2020 Essa script do Yalahar Quest você copiou do jeito errado e esqueceu do end no final, deixa ela assim:
-
Storm's post in (Resolvido)Script Bugado. was marked as the answer@Pifafa Mas ele consegue usar o Exercise Bow quando está com a magia ativa? Se conseguir, tenta assim:
if getCreatureCondition(cid, CONDITION_ATTRIBUTES, 1) then doPlayerSendTextMessage(cid, 27, "Voce nao pode usar o Exercise Bow com um buff ativo.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end
-
Storm's post in (Resolvido)[PEDIDO] Ganhar recompensa ao matar jogador was marked as the answer@OinomedRellik Tenta assim:
-
Storm's post in (Resolvido)!akatsuki was marked as the answer@REI DAVID
local storage = 43455 local t = { [1] = {lookType = 203}, -- [vocation ID] = {lookType = outfit id} [2] = {lookType = 204}, } function onSay(cid, words, param, channel) local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, storage) == 1 then local outfit = t[getPlayerVocation(cid)] if outfit then if outfit ~= getCreatureOutfit(cid).lookType then doChangeCreatureOutfit(cid, outfit) db.executeQuery("UPDATE `players` SET `looktype`=".. outfit .." WHERE `players`.`id`= ".. getPlayerGUID(cid) .."") doSendMagicEffect(pos, 10) doCreatureSay(cid, "AKATSUKI!!", TALKTYPE_MONSTER) return true else doPlayerSendTextMessage(cid, 27, "Voce ja esta transformado!") doSendMagicEffect(pos, 4) return true end else doPlayerSendTextMessage(cid, 27, "Sua vocacao nao se transformar em akatsuki") doSendMagicEffect(pos, 4) return true end else doPlayerSendTextMessage(cid, 27, "Voce nao tem a storage") doSendMagicEffect(pos, 4) return true end return true end
-
Storm's post in (Resolvido)Consertar script was marked as the answer@Platinun
local dolls = { [2344] = {pet = "rat"}, [2139] = {pet = "rat"}, } O erro que dá é, quando o player usa o item, ele não está configurado na tabela acima.
Adiciona o ID do item na tabela acima e testa
-
Storm's post in (Resolvido)Erro spells was marked as the answer@eunaosei123
local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, TRUE) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 35) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -15, -20, -21, -23) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, TRUE) setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 35) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -15, -20, -21, -23) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat3, COMBAT_PARAM_BLOCKARMOR, TRUE) setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 35) setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -15, -20, -21, -23) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end local function onCastSpell2(parameters) doCombat(parameters.cid, parameters.combat2, parameters.var) end local function onCastSpell3(parameters) doCombat(parameters.cid, parameters.combat3, parameters.var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5, combat6 = combat6, combat7 = combat7, combat8 = combat8, combat9 = combat9, combat10 = combat10 } addEvent(onCastSpell1, 100, parameters) addEvent(onCastSpell2, 500, parameters) addEvent(onCastSpell3, 1000, parameters) if isPlayer(variantToNumber(var)) then doPlayerSendTextMessage(variantToNumber(var), 27, "EFEITO MÁGICO: Meteoro glacial foi ativado, afetando o inimigo múltiplas vezes (3x). O cálculo do dano de ataque é baseado em seu nível mágico.") end return TRUE end
-
Storm's post in (Resolvido)Verificar posição de um player was marked as the answer@Joaovettor
function checkPlayersAround(uid) local players = {} -- Deixe vazio local pos = getCreaturePosition(uid) local positions = { [1] = {x = pos.x -1, y = pos.y, z = pos.z}, [2] = {x = pos.x +1, y = pos.y, z = pos.z}, [3] = {x = pos.x, y = pos.y +1, z = pos.z}, [4] = {x = pos.x, y = pos.y -1, z = pos.z} } for _, var in pairs(positions) do for i = 0, 255 do var.stackpos = i tile = getTileThingByPos(var) if tile.uid > 0 and isPlayer(tile.uid) then table.insert(players, tile.uid) end end end return players end function onUse(cid, item, frompos, item2, topos) if table.maxn(checkPlayersAround(cid)) > 0 then doSendMagicEffect(getCreaturePosition(cid), 17) end return true end
-
Storm's post in (Resolvido)Potions mostrar quantidade de heal was marked as the answer@mullino
-
Storm's post in (Resolvido)Alguem pra me ensinar scripting ou a mecher em source was marked as the answer@nghlit https://tibiaking.com/forums/forum/220-aulas-de-scripting/
-
Storm's post in (Resolvido)Fazer item sumir was marked as the answer@leozincorsair Hiraishin Kunai né, enfim ano passado eu fiz uma script assim, não sei se funciona e se ta do jeito que você quer, testa ai:
-
Storm's post in (Resolvido)[PEDIDO] Cooldown da Spell was marked as the answer@ZeeroBR
local configSpell = { exhaustStorage = 55230, -- se quiser pode mudar exhaustTime = 5 -- exhausted em segundos } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -16, 0, -16, 0) local function isWalkable(pos, creature, pz, proj) if(getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0) then return false end if(getTilePzInfo(pos) and not pz) then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if(tile.itemid ~= 0 and not isCreature(tile.uid)) then if(hasProperty(tile.uid, n) or hasProperty(tile.uid, 7)) then return false end end end if(getTopCreature(pos).uid ~= 0 and not creature) then return false end return true end local function doSpell(cid, target, var) local pos = getThingPos(target) local posit = getCreaturePosition(cid) local posi = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} local config = { [NORTH] = {SOUTH, {x=pos.x, y=pos.y+1, z=pos.z}}, [EAST] = {WEST, {x=pos.x-1, y=pos.y, z=pos.z}}, [SOUTH] = {NORTH, {x=pos.x, y=pos.y-1, z=pos.z}}, [WEST] = {EAST, {x=pos.x+1, y=pos.y, z=pos.z}} } local a, b = config[getCreatureLookDirection(target)], getCreatureLookPosition(target) if(isWalkable(a[2]) and isWalkable(b)) then doTeleportThing(cid, a[2], false) doCreatureSetLookDirection(cid, getCreatureLookDirection(target)) doSendMagicEffect(posit, 390) doCombat(cid, combat, var) exhaustion.set(cid, configSpell.exhaustStorage, configSpell.exhaustTime) doSendMagicEffect(posi, 298) else doPlayerSendCancel(cid, "Não pode ir para lá.") return false end return true end function onCastSpell(cid, var) if(isPlayer(cid) and exhaustion.check(cid, configSpell.exhaustStorage)) then doPlayerSendCancel(cid, "Voce está exausto.") return false end return doSpell(cid, getCreatureTarget(cid), var) end