Solutions
-
MatteusDeli's post in Bug script action item de summon was marked as the answer@Gatinha Pirada Boa tarde, tente assim:
local monsters = {"Druid familiar"} -- todos os monsters que podem ser summonados. local time = 30 -- tempo em minutos para usar o item novamente. local storage = 10923 -- storage qualquer, que não esteja em uso. function onUse(cid, Item, fromPosition, itemEx, toPosition) if isInArray({2,4}, getPlayerVocation(cid)) then -----> vocaciones 4 8 puede aumentar mas local summon = getCreatureSummons(cid) if (table.maxn(summon) < 1) then if getPlayerStorageValue(cid, storage) - os.time() <= 0 then local summonRandom = monsters[math.random(#monsters)] doSummonMonster(cid, summonRandom) doPlayerSendTextMessage(cid, 22, "Você summonou uma Criatura!") setPlayerStorageValue(cid, storage, os.time() + time*60) for _, pid in ipairs (getCreatureSummons(cid)) do doSendMagicEffect(getCreaturePosition(pid), 15) doCreatureSay(pid, "Vou Te Ajudar", TALKTYPE_ORANGE_1) end else doPlayerSendCancel(cid, "Voce so pode usar esse item a cada "..time.." Minuto(s).") end elseif (table.maxn(summon) > 0) then for _, pid in ipairs(getCreatureSummons(cid)) do doCreatureSay(pid, "Tchau", TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(pid), 2) doRemoveCreature(pid) end doPlayerSendTextMessage(cid, 22, "Voce Removeu A Criatura.") end else doPlayerSendTextMessage(cid, 22, "voce nao e druid.") end return true end
-
MatteusDeli's post in (Resolvido)[TALK] -=[TFS]=- 0.4 v8.60 Queria que vendesse tudo de uma vez no comando !sellall e 1 de cada no comando !sell was marked as the answer@Muvuka Boa noite.
local items = {} local sellTable = { [2498] = 40000, [2475] = 6000, [2497] = 9000, [2491] = 5000, [2462] = 4000, [2663] = 500, [2458] = 35, [2459] = 30, [2645] = 400000, [2195] = 40000, [2646] = 100000, [2472] = 100000, [2492] = 60000, [2494] = 90000, [2466] = 30000, [2487] = 20000, [2476] = 5000, [2656] = 15000, [2500] = 2500, [2463] = 400, [2465] = 200, [2464] = 100, [2470] = 80000, [2488] = 15000, [2477] = 6000, [2647] = 500, [2487] = 100, [2514] = 80000, [2520] = 40000, [2523] = 150000, [2522] = 100000, [2534] = 25000, [2536] = 8000, [2537] = 4000, [2519] = 5000, [2528] = 4000, [2515] = 200, [2518] = 1500, [2525] = 100, [2390] = 150000, [2408] = 100000, [2400] = 90000, [2393] = 10000, [2407] = 6000, [2396] = 4000, [2392] = 3000, [2409] = 1500, [2383] = 800, [2377] = 400, [2413] = 70, [2406] = 30, [2376] = 25, [2414] = 10000, [2431] = 90000, [2427] = 7500, [2432] = 10000, [2430] = 2000, [2387] = 200, [2381] = 200, [2378] = 100, [2388] = 20, [2391] = 6000, [2421] = 90000, [2436] = 1000, [2434] = 2000, [2423] = 200, [2417] = 60, [2398] = 30, } function get_items_container(cid, uid) local size = getContainerCap(uid) for slot = (size - 1), 0, -1 do local item = getContainerItem(uid, slot) if item.uid > 0 then if sellTable[item.itemid] then table.insert(items, item.itemid) elseif isContainer(item.uid) then get_items_container(cid, item.uid) end end end return items end function onSay(cid, words, param, channel) items = {} local backpack = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK).uid if (words == "!sellall") then sellAllItems(cid, backpack) return true end if (words == "!sell") then if (param == nil) then return false end sellItem(cid, param, backpack) return true end return true end function sellItem(cid, item, backpack) local items = get_items_container(cid, backpack) if #items <= 0 then return false end local itemId = items[1] local money = sellTable[itemId] local itemName = getItemNameById(itemId) if string.lower(itemName) ~= string.lower(item) then return false end sell(cid, itemId, money) return true end function sellAllItems(cid, backpack) local items = get_items_container(cid, backpack) if #items <= 0 then return false end for i = 1, #items do local item = items[i] local money = sellTable[item] sell(cid, item, money) end return true end function sell(cid, item, money) doPlayerAddMoney(cid, money) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sold ".. getItemNameById(item) .." for ".. money .." gold.") doPlayerRemoveItem(cid, item, 1) end
-
MatteusDeli's post in (Resolvido)Tile que gasta soul ao entrar was marked as the answer@deza Boa noite, não testei o script mais acho que seria isso
em data/movements crie um arquivo chamado soul.lua e cole isso nele
local config = { soul = 10, -- Quantidade de soul que será removida message = { text = "Voce nao possui soul suficiente para passar aqui", color = MESSAGE_STATUS_CONSOLE_BLUE } } function onStepIn(cid, item, position, fromPosition) local playerSoul = getPlayerSoul(cid) if not isPlayer(cid) then return false end if playerSoul < config.soul then doPlayerSendTextMessage(cid, config.message.color, config.message.text) doTeleportThing(cid, fromPosition) return false end doPlayerAddSoul(cid, -config.soul) return true end
em movements.xml adicione esta linha nele:
<movevent event="StepIn" actionid="XXXX" script="soul.lua" />
Aonde esta XXXX você coloca o actionId do tile que ativará o script
-
MatteusDeli's post in (Resolvido)Como arrumar o npc que da vocation apos level 200? was marked as the answer@juvelino Opa, não testei mais creio que é isso:
local config = { storage = 457771, cost = 1000000, -- Quantidade em gold (1000000 = 1kk) minimumLevel = 200, -- Level minimo necessario vocation = { sorcerer = { id = 1, name = "Sorcerer"}, druid = { id = 2, name = "Druid"}, paladin = { id = 3, name = "Paladin"}, knight = { id = 4, name = "Knight"}, } } 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 choose = {} local cancel = {} local available = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid if(msgcontains(msg, "info")) then selfSay("Olá "..getCreatureName(cid)..", Você quer trocar de vocação, digite o nome da sua proxima vocação. Temos Sorcerer, Druid, Knight e Paladin.", cid) talkState[talkUser] = 1 if canChangeVocation(cid) == false then selfSay("Desculpe, mais voce so pode trocar de vocacao apenas uma vez", cid) talkState[talkUser] = 0 return false end if haveEnoughLevel(cid) == false then selfSay("Desculpe, voce nao possui level suficiente", cid) talkState[talkUser] = 0 return false end removeMoney(cid) elseif msgcontains(msg, "sorcerer") or msgcontains(msg, "SORCERER") and talkState[talkUser] == 1 then addVocation(cid, config.vocation.sorcerer.id, config.vocation.sorcerer.name) elseif msgcontains(msg, "druid") or msgcontains(msg, "DRUID") and talkState[talkUser] == 1 then addVocation(cid, config.vocation.druid.id, config.vocation.druid.name) elseif msgcontains(msg, "paladin") or msgcontains(msg, "PALADIN") and talkState[talkUser] == 1 then addVocation(cid, config.vocation.paladin.id, config.vocation.paladin.name) elseif msgcontains(msg, "KNIGHT") or msgcontains(msg, "KNIGHT") and talkState[talkUser] == 1 then addVocation(cid, config.vocation.knight.id, config.vocation.knight.name) elseif(msgcontains(msg, "bye") or msgcontains(msg, "goodbye") or msgcontains(msg, "cya")) then selfSay("cya!", cid, TRUE) closeShopWindow(cid) removeFocus(cid) end end function canChangeVocation(cid) if getPlayerStorageValue(cid, config.storage) <= 0 then return true end return false end function haveEnoughLevel(cid) if getPlayerLevel(cid) >= config.minimumLevel then return true end return false end function removeMoney(cid) if getPlayerMoney(cid) < config.cost then selfSay("Voce nao possui dinheiro suficiente.", cid) return false end doPlayerRemoveMoney(cid, config.cost) end function addVocation(cid, id, name) doPlayerSetVocation(cid, id) selfSay("Parabéns, você virou um "..name, cid) broadcastMessage("O jogador "..getCreatureName(cid).." virou um "..name) setPlayerStorageValue(cid, config.storage, 1) end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Na parte que o npc não estar adicionando a vocação, voce pode checar em data/XML o arquivo de vocations.xml acho que bug pode estar lá, vou deixar um exemplo do script padrão dele: (Tente alterar para o script abaixo e faça o teste se irá funcionar)
<?xml version="1.0" encoding="UTF-8"?> <vocations> <vocation id="0" name="None" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="2"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="8" gainhpamount="1" gainmanaticks="4" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="4"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="6" name="Elder Druid" description="an elder druid" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="2" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="7" name="Royal Paladin" description="a royal paladin" needpremium="1" gaincap="20" gainhp="10" gainmana="15" gainhpticks="6" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="3" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="8" name="Elite Knight" description="an elite knight" needpremium="1" gaincap="25" gainhp="15" gainmana="5" gainhpticks="4" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="4" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <!-- <vocation id="9" name="Epic Master Sorcerer" description="an epic master sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="5" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="10" name="Epic Elder Druid" description="an epic elder druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="1" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="6" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="11" name="Epic Royal Paladin" description="an epic royal paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.4" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="7" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> <vocation id="12" name="Epic Elite Knight" description="an epic elite knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="2" gainhpamount="1" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="8" lessloss="50"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/> </vocation> --> </vocations>
-
MatteusDeli's post in (Resolvido)poção de cura % was marked as the answer@Black Frost21 Bom tarde, acho que é isso:
Em data/actions/scripts crie um arquivo chamado healPill.lua e adicione isso dentro:
local config = { -- [ID DO ITEM] = { health = Porcentagem de Vida, mana = Porcentagem de Mana}, -- Pilula de mana [XXXX] = { health = 0, mana = 20 }, -- Pilula de saude [YYYY] = { health = 20, mana = 0 }, -- grande Pilula [ZZZZ] = { health = 20, mana = 35 }, } function onUse(cid, item, from, itemEx, to) local pill = config[item.itemid] addHelth(cid, pill.health) addMana(cid, pill.mana) return true end function addHelth(cid, percentageHealth) if (percentageHealth > 0) then local playerMaxHealth = getCreatureMaxHealth(cid) local healthAmount = calculatePercentageRestoration(playerMaxHealth, percentageHealth) doCreatureAddHealth(cid, healthAmount) end end function addMana(cid, percentageMana) if (percentageMana > 0) then local playerMaxMana = getCreatureMaxMana(cid) local manaAmount = calculatePercentageRestoration(playerMaxMana, percentageMana) doCreatureAddMana(cid, manaAmount) end end function calculatePercentageRestoration(value, percentage) return math.ceil(math.abs((value * (percentage / 100)+0.5))) end
No arquivo actions.xml adicione isso:
<action itemid="XXXX;YYYY;ZZZZ" script="healPill.lua"/>
Aonde estão os XXXX;YYYY;ZZZZ são os ids dos itens que serão utilizados para recuperar a vida e a mana, lembre-se de alterar no script também.
-
MatteusDeli's post in (Resolvido)Exausted was marked as the answer@Doidodepeda Boa noite, tente assim:
Altere o xml para:
Separe cada itemid da potion por ";", como está abaixo
<action itemid="7440;7439" script="expPotions.lua"/>
Altere o script para esse, está comentado como usar:
local expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal. local textoPotionUsada = "em uso" local potions = { -- [ID_POTION] = { tempo = DURAÇÃO, experiencia = EXPERIENCIA, quantidade = QUANTIDADE_DE_POTIONS, texto = 'Voce Ganhou 30 Minutos de Exp [3x]', textofinal = 'Bonus de Exp [3x] Finalizada', storage = STORAGE_UNICO_PARA_CADA_POTION, textoClasse = 22, efeito = 1 }, [7440] = { tempo = 1800, experiencia = 3.0, quantidade = 1, texto = 'Voce Ganhou 30 Minutos de Exp [3x]', textofinal = 'Bonus de Exp [3x] Finalizada', storage = 33330, textoClasse = 22, efeito = 1 }, [7439] = { tempo = 2000, experiencia = 5.0, quantidade = 1, texto = 'Voce Ganhou 30 Minutos de Exp [5x]', textofinal = 'Bonus de Exp [5x] Finalizada', storage = 33331, textoClasse = 22, efeito = 1 } } function onUse(cid, item, frompos, item2, topos) for potionId, potionConfig in pairs(potions) do if item.itemid == potionId then if (getPlayerStorageValue(cid, potionConfig.storage) > os.time()) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, textoPotionUsada) return; end local quantidadePotionPlayer = getPlayerItemCount(cid, potionId) if quantidadePotionPlayer < potionConfig.quantidade or quantidadePotionPlayer <= 0 then return; end doRemoveItem(item.uid, potionConfig.quantidade) doPlayerSetExperienceRate(cid, potionConfig.experiencia) doSendMagicEffect(frompos, potionConfig.efeito) doPlayerSendTextMessage(cid, potionConfig.textoClasse, potionConfig.texto) addEvent(potion, potionConfig.tempo * 1000, cid, potionConfig) setPlayerStorageValue(cid, potionConfig.storage, (os.time() + potionConfig.tempo)) end end end function potion(cid, potionConfig) doPlayerSetExperienceRate(cid, expfinal) doPlayerSendTextMessage(cid, potionConfig.textoClasse, potionConfig.textofinal) end
-
MatteusDeli's post in ERRO NO NPC REVIVER was marked as the answer@Muvuka Boa tarde, remova esta linha do script:
npcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Eu posso te {reviver} no local aonde voce morreu recentemente por uma certa quantidade de dinheiro.")
No arquivo xml do npc, substitua para isto:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Reviver" script="data/npc/scripts/reviver.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="300" head="0" body="0" legs="0" feet="0" corpse="5995"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Eu posso te {reviver} no local aonde voce morreu recentemente por uma certa quantidade de dinheiro."/> </parameters> </npc>
-
MatteusDeli's post in (Resolvido)8.60 NPC Revive was marked as the answer@Muvuka Boa tarde, as configurações estão comentadas no script do npc.
data/npc crie um arquivo chamado reviver.xml e adicione isto dentro:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Reviver" script="data/npc/scripts/reviver.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="300" head="0" body="0" legs="0" feet="0" corpse="5995"/> <parameters /> </npc>
data/npc/scripts crie um arquivo chamado reviver.lua e adicione isto dentro:
local MONEY_AMOUNT = 1000 --Quantidade de dinheiro (em gold coins) que o player necessitará para reviver local MAGIC_EFFECT_TELEPORT = 65 -- Efeito que aparecerá quando o player for teleportado local PLAYER_REBORN_POSITION_X = 66541 local PLAYER_REBORN_POSITION_Y = 66542 local PLAYER_REBORN_POSITION_Z = 66543 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 npcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Eu posso te {reviver} no local aonde voce morreu recentemente por uma certa quantidade de dinheiro.") function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'reviver') or msgcontains(msg, 'revive')) then selfSay('Voce precisa de ' .. MONEY_AMOUNT .. ' gold(s) para ressuscitar no local aonde voce morreu recentemente', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(getPlayerMoney(cid) >= MONEY_AMOUNT) then doPlayerRemoveMoney(cid, MONEY_AMOUNT) if teleportPlayerToPositionReborn(cid) then doTeleportThing(cid, { x=playerRebornPositionX, y=playerRebornPositionY, z=playerRebornPositionZ }) doSendMagicEffect(getThingPos(cid), MAGIC_EFFECT_TELEPORT) selfSay('Ok, voce foi ressuscitado', cid) end else selfSay('Desculpe, mais voce nao possui o dinheiro suficiente.', cid) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then talkState[talkUser] = 0 selfSay('Ok, ate mais.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) function teleportPlayerToPositionReborn(cid) local playerRebornPositionX = getPlayerStorageValue(cid, PLAYER_REBORN_POSITION_X) local playerRebornPositionY = getPlayerStorageValue(cid, PLAYER_REBORN_POSITION_Y) local playerRebornPositionZ = getPlayerStorageValue(cid, PLAYER_REBORN_POSITION_Z) if (playerRebornPositionX <= -1 or playerRebornPositionY <= -1 or playerRebornPositionZ <= -1) then selfSay('Voce nao morreu nenhuma vez ainda.', cid) return false end doTeleportThing(cid, { x=playerRebornPositionX, y=playerRebornPositionY, z=playerRebornPositionZ }) return true end
Agora em data/creaturescripts/scripts, crie um arquivo chamado reviver.lua e adicione isto dentro dele:
local PLAYER_REBORN_POSITION_X = 66541 local PLAYER_REBORN_POSITION_Y = 66542 local PLAYER_REBORN_POSITION_Z = 66543 function onDeath(cid, corpse, deathList) if not isPlayer(cid) then return true end local player_position = getThingPos(cid) setPlayerStorageValue(cid, PLAYER_REBORN_POSITION_X, player_position.x) setPlayerStorageValue(cid, PLAYER_REBORN_POSITION_Y, player_position.y) setPlayerStorageValue(cid, PLAYER_REBORN_POSITION_Z, player_position.z) return TRUE end
Em data/creaturescripts abra o arquivo creaturescripts.xml e adicione está linha nele:
<event type="death" name="PlayerReborn" event="script" value="reviver.lua"/>
Por ultimo registre o evento no arquivo login.lua dentro da pasta data/creaturescripts/scripts adicionando esta linha no arquivo:
registerCreatureEvent(cid, "PlayerReborn")
Espero ter ajudado.
-
MatteusDeli's post in mudar script de teleportar de tfs 0.4 para tfs 1.2 was marked as the answer@jhonathan wendrell Boa noite,
<talkaction words="/ir" separator=" " script="NOME_DO_ARQUIVO.lua" />
function onSay(player, words, param) local STORAGE_JAIL = 50026 local config = { pz = false, -- players precisam estar em protection zone para usar? (true or false) battle = true, -- players deve estar sem battle (true or false) custo = false, -- se os teleport irão custa (true or false) need_level = false, -- se os teleport irão precisar de level (true or false) premium = false -- se precisa ser premium account (true or false) } --[[ Config lugares]]-- local lugar = { ["formorgar2"] = { pos = {x=2094, y=136, z=8},level = 1,price = 0, premium = 1}, ["wyrm"] = { pos = {x=528, y=1529, z=7},level = 1,price = 0, premium = 1}, ["erech"] = { pos = {x=1070, y=1250, z=5},level = 1,price = 0, premium = 1}, ["veglon"] = { pos = {x=228, y=449, z=7},level = 1,price = 0, premium = 1}, } local a = lugar[param] local STORAGE_IR = 12701 local delay = 1 * 1.2 local lastUse = player:getStorageValue(STORAGE_IR) local ticks = os.time() - lastUse if ticks < delay then return true end player:setStorageValue(STORAGE_IR, os.time()) if not(a) then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "As cidades que voce pode ir sao: edoras, belfallas, ashenport, bree, riv, dol, esg, argond, moria, mordor, forod, condado, dunedain, anfallas, minas.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Lugares onde Apenas VIPS podem ir:") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Até Level 30: promoOrc, troll1, troll2, rot, pirata, mino1, mino2, pantano, eriador, dwarf1, dwarf2, macacos1, macacos2, slime1, slime2, slime3, ghoul, bandit1, bandit2, cyc1, cyc2, cyc3, stonegolem, dworc1, eregion.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "De level 31 a 100: rhun, dragonvip, erebor, mirkwood, forochel, carn, enedwaith, elven, elven2, wyvern, corsario, dunland, icedunland, beleghost, evendim, bonebeast1, bonebeast2, orc, blacknight1, blacknight2, hero1, hero2, hero3, hydra1, hydra2, hydra3, lich, icewitch1, icewitch2, crystal, barbarian, dragon1, dragon2, vamp, turtle, purga, quara.") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "Level maior que 100: erech, formorgar, formorgar2, wyrm, veglon, northern, ered, orodruin, ice, nimrais, defiler, behedemon, harlond, northern2.") return true end if (config.premium == true and player:getPremiumDays() <= 0) then player:sendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas contas VIP tem esse recurso.") end if (player:getStorageValue(STORAGE_JAIL) > os.time()) then player:sendTextMessage(MESSAGE_INFO_DESCR, 'Você só pode sair as '.. os.date("%H:%M:%S", player:getStorageValue(STORAGE_JAIL))..' (agora são: ' .. os.date("%H:%M:%S", os.time()) .. ').') return true end if (config.battle == true and player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) ~= nil) then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Você não pode se teleportar em uma batalha.") return true end if a.premium == 1 and player:getPremiumDays() <= 0 then player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Apenas contas VIP podem acessar esse lugar.") return true end local pos = Position(a.pos.x, a.pos.y, a.pos.z) if player:getGroup():getId() >= 3 then player:teleportTo(pos) return true end player:getPosition():sendMagicEffect(27) player:teleportTo(pos) player:getPosition():sendMagicEffect(40) return true end
-
MatteusDeli's post in (Resolvido)Problema NPC DAILY was marked as the answer@knepperzik
Então o jeito que eu tinha feito é que toda fez que o player logar iria resetar as storages da task, então ele teria que finalizar a task sempre online. Eu fiz uma alteração no script tente fazer desta forma pra ver se funciona, toda vez que o servidor iniciar ele vai zerar todas as storages dos players que começaram a task, segue o script:
Primeiro de tudo, vá no arquivo data/creaturescripts/scripts e abra o login.lua e remova as linhas que você adicionou usando o script anterior:
Vá em data/globalevents/scripts e crie um arquivo chamado dailyReset.lua e cole isto dentro:
Registre o script no globalevents.xml adicionando esta linha nele :
Agora, vá em data/npc/scripts e procuro pelo script do NPC daily que se chama tasker (caso tenha mudado o nome então procuro pelo nome que voce alterou) e troque por esse script :
-
MatteusDeli's post in (Resolvido)Dar use em item e aparecer monstro was marked as the answer@Lisbeky Boa noite, segue o script:
data/actions/scripts crie um arquivo chamado ankh.lua e cole isto dentro:
local config = { time = 3, -- Tempo em segundos para aparecer o monstro effect = 10, -- Efeito que ira sair quando o monstro for trocado monster_created = "demon", -- Nome do monstro que será criado monster_removed = "Orc" -- Nome do monstro que será removido } function onUse(cid, item, frompos, itemEx, topos) if not (isMonster(itemEx.uid)) then doPlayerSendCancel(cid, "Use este item apenas em monstros.") return true end if not (string.lower(getCreatureName(itemEx.uid)) == string.lower(config.monster_removed)) then doPlayerSendCancel(cid, "Voce nao pode usar este item neste monstro.") return true end doRemoveCreature(itemEx.uid) addEvent(function() doCreateMonster(config.monster_created, topos) doSendMagicEffect(topos, config.effect) end, config.time*1000) end data/actions/actions.xml
<action actionid="100" event="script" value="ankha.lua" />
-
MatteusDeli's post in (Resolvido)[CREATURESCRIPT] Ajuda com script was marked as the answer@gabrielbuff Boa noite, tenta assim:
-
MatteusDeli's post in (Resolvido)Erro sistema de points lib.lua was marked as the answer@gabrielbuff Bom dia, cheque se na tabela accounts tem uma coluna chamada c_points, se não tiver execute este comando na database:
ALTER TABLE accounts ADD c_points INTEGER DEFAULT 0;
-
MatteusDeli's post in (Resolvido)Storage sumindo was marked as the answer@eunaosei123 Bom dia, tente assim:
Eu alterei o seu script e centralizei toda a configuração dele no arquivo 066-heal para facilitar.
1 - Vá em data/lib e crie um arquivo chamado 066-heal e cole isto dentro:
2 - Vá em data/actions/scripts e abra o seu script atual e altere para este:
3- Vá em data/creatureevents/scripts e crie um arquivo chamado healLogout.lua e cole isto dentro:
- Por último abra o creatureevents.XML e cole estas duas tags dentro:
-
MatteusDeli's post in (Resolvido)Teleport Alavanca was marked as the answer@bellatrikz Boa Tarde, segue o script:
local positions = { -- Aqui você coloca todas as posições que você quer que o player esteja para ser teleportado {x=841,y=1438,z=9}, {x=842,y=1438,z=9}, } function onSay(cid, words, param) for i=1, #positions do local player_pos = getCreaturePosition(cid) if (player_pos.x == positions[i].x and player_pos.y == positions[i].y and player_pos.z == positions[i].z) then if isPlayer(cid) then doTeleportThing(cid,{x=841,y=1435,z=9}) doSendMagicEffect(player_pos,10) doPlayerSendTextMessage(cid,25,"You have found the secret word") return true end end end doPlayerSendTextMessage(cid,25,"You need to step in to digit this comand") doSendMagicEffect(getCreaturePosition(cid),2) return true end
-
MatteusDeli's post in (Resolvido)[Pedido] Comprar Storage e ganhar acesso was marked as the answer@Phineasz Boa noite, vê se é assim que você quer
data/talkactions crie um arquivo chamado vip2.lua e adicione isto dentro:
local storage_vip = 7884451 local price_vip = 100 -- 100 = 1kk em crystal coins local money_id = 2160 -- itemid do dinheiro neste caso sera crystal coin function onSay(cid, words, param, channel) if (getPlayerItemCount(cid, money_id) >= price_vip) then doPlayerRemoveItem(cid, money_id, price_vip) setPlayerStorageValue(cid, storage_vip, 1) doPlayerSendCancel(cid, "Voce comprou a vip 2.") else doPlayerSendCancel(cid, "Voce precisa de 1kk para comprar a vip 2.") return true end return true end talkactions.xml:
<talkaction words="!buyvip2" event="script" value="vip2.lua" /> data/moveevents crie um arquivo chamado vip2tile.lua e adicione isto dentro:
local storage_vip = 7884451 -- mesma storage que esta no talkaction function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return false end if (getPlayerStorageValue(cid, storage_vip) >= 1) then doPlayerSendCancel(cid, "Bem vindo.") doSendMagicEffect(getThingPos(cid), 12) else doTeleportThing(cid, fromPosition) doSendMagicEffect(getThingPos(cid), 2) doPlayerSendCancel(cid, "Voce nao pode passar aqui.") return true end return true end moveevents.xml:
<movevent type="StepIn" actionid="XXXX" event="script" value="vip2tile.lua"/> OBS: Aonde está XXXX você coloca a actionid no tile que irá executar o script.
-
MatteusDeli's post in (Resolvido)Boosted Creature was marked as the answer@bellatrikz Boa noite, veja se é isso que voce quer
data/lib crie um arquivo chamado boostedMonster.lua e cole isto dentro:
monster_name_backup = 74812 -- nao mexer monster_exp_backup = 74813 -- nao mexer monster_loot_backup = 74814 -- nao mexer config_boosted = { ["00:00:00"] = { -- Horario de cada dia que irá ocorrer a troca dos monstros pos_monster = {x=161,y=58,z=7, stackpos = 253}, -- a posição aonde ficara o monstro informando a quantidade de exp e loot time_effects = 2 -- tempo em segundos que ficará saindo os efeitos } } monsters_boosteds = { -- Configuracao dos monstros que irão ter exp e loot aumentados [1] = {monster_name = "Dwarf", exp = 5, loot = 7}, [2] = {monster_name = "Goblin", exp = 15, loot = 5}, [3] = {monster_name = "Orc", exp = 25, loot = 15}, [4] = {monster_name = "Dwarf Soldier", exp = 35, loot = 10}, --[5] = {monster_name = "NOME DO MONSTRO", exp = "PORCENTAGEM DE EXP", loot = "PORCENTAGEM DO LOOT"}, }
agora em data/globalevents/scripts crie um arquivo chamado boosted.lua e cole isto dentro:
function onThink(interval, lastExecution) local current_hour = os.date("%X") if config_boosted[current_hour] then local time = config_boosted[current_hour] local monster = getTopCreature(time.pos_monster).uid local random_monster = monsters_boosteds[math.random(1, #monsters_boosteds)] if (monster >= 1) then doRemoveCreature(monster) end SummonMonster(time, random_monster) setGlobalStorageValue(monster_name_backup, random_monster.monster_name) setGlobalStorageValue(monster_exp_backup, random_monster.exp) setGlobalStorageValue(monster_loot_backup, random_monster.loot) end return true end function SummonMonster(time, monster) doCreateMonster(monster.monster_name, time.pos_monster) effectsMonster(time, monster) end function effectsMonster(time, monster) effectLoot(time.pos_monster, monster) effectExp(time.pos_monster, monster) doSendMagicEffect(time.pos_monster, 30) doSendAnimatedText(time.pos_monster, "Boosted", COLOR_DARKYELLOW) addEvent(function() effectsMonster(time, monster) end, time.time_effects * 1000) end function effectLoot(pos, monster) local pos_effect = {x=pos.x, y=pos.y-1, z=pos.z} doSendMagicEffect(pos_effect, 29) doSendAnimatedText(pos_effect, "Loot +"..monster.loot.."%", COLOR_DARKYELLOW) end function effectExp(pos, monster) local pos_effect = {x=pos.x, y=pos.y+1, z=pos.z} doSendMagicEffect(pos_effect, 29) doSendAnimatedText(pos_effect, "EXP +"..monster.exp.."%", COLOR_DARKYELLOW) end Em globalevents.xml registre esta tag:
<globalevent name="boosted" interval="1000" event="script" value="boosted.lua"/>
Agora em data/creatureevents/scripts crie um arquivo chamado boosted.lua e cole isto dentro:
function onKill(cid, target, damage, flags) if not (isMonster(target)) then return true end if (string.lower(getCreatureName(target)) == string.lower(getGlobalStorageValue(monster_name_backup))) then local exp = tonumber(getGlobalStorageValue(74813)) doPlayerSetRate(cid, SKILL__LEVEL, getExperienceStage(getPlayerLevel(cid))*(getGlobalStorageValue(monster_exp_backup) / 1000)) addLoot(getCreaturePosition(target), getCreatureName(target), {}) else doPlayerSetRate(cid, SKILL__LEVEL, 1) end return true end function addLoot(position, name, ignoredList) local check = false for i = 0, 255 do position.stackpos = i corpse = getTileThingByPos(position) if corpse.uid > 0 and isCorpse(corpse.uid) then check = true break end end if check == true then local newRate = (1 + (getGlobalStorageValue(monster_loot_backup)/100)) * getConfigValue("rateLoot") local mainbp = doCreateItemEx(1987, 1) local monsterLoot = getMonsterLootList(name) for i, loot in pairs(monsterLoot) do if math.random(1, 100000) <= newRate * loot.chance then if #ignoredList > 0 then if (not isInArray(ignoredList, loot.id)) then doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1) end else doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1) end end end doAddContainerItemEx(corpse.uid, mainbp) end end
Em creatureevent.xml registre esta tag:
<event type="kill" name="BoostedMonster" event="script" value="boosted.lua"/>
Por ultimo abra o arquivo login.lua na mesma pasta (creatureevents/scripts) e cole esta linha antes do ultimo return true:
registerCreatureEvent(cid, "BoostedMonster")
OBS: A explicação de como adicionar os monstros etc.. Esta no arquivo boostedMonster.lua em data/lib.
-
MatteusDeli's post in (Resolvido)[PEDIDO] Puxar alavanca e surgir monsters was marked as the answer@juvelino
position_lobby = { -- Posição da sala no formato quadrado x1 = {x=174,y=61,z=7}, x2 = {x=180,y=67,z=7} } summons = { [1] = { monster= "Demon", pos= {x = 174 ,y = 61,z = 7}}, [2] = { monster= "Demon", pos={x = 180,y = 67,z = 7}}, --[3] = {monster = "Morgaroth", pos = {x= 181, y= 55, z= 7}}, } mensagemBroadcast = "Tem um time upando nas ruínas" function onUse(cid, item, fromPosition, itemEx, toPosition) local monsters_in_lobby = {} for posX=position_lobby.x1.x, position_lobby.x2.x do for posY=position_lobby.x1.y, position_lobby.x2.y do local newPos = {x=posX,y=posY,z=7, stackpos=253} local monsters = getTopCreature(newPos).uid if (isMonster(monsters)) then if (monsters > 0) then table.insert(monsters_in_lobby, monsters) end end end end if (#monsters_in_lobby == 0) then for i=1, #summons do doCreateMonster(summons[i].monster, summons[i].pos) end SetSwitch(item) doBroadcastMessage(mensagemBroadcast) else doPlayerSendCancel(cid, "Voce tem que matar todos os demons.") end return true end function SetSwitch(item) if (item.itemid == 1945) then doTransformItem(item.uid, item.itemid+1) end if (item.itemid == 1946) then doTransformItem(item.uid, item.itemid-1) end end
-
MatteusDeli's post in (Resolvido)Npc task diaria was marked as the answer@usoparagames Veja se é isso que você quer.
1 - INSTALANDO O SCRIPT NA LIB DO SERVIDOR
2 - CRIANDO O NPC DAILY
3 - CONFIGURANDO O CREATURESCRIPTS
4 - CONFIGURANDO UM NOVO POKEMON
-
MatteusDeli's post in (Resolvido)[Action] Bau was marked as the answer@ASSAFSAF
Veja se é assim que você quer:
1 - data/scripts/actions crie um arquivo chamado questDaily.lua:
local storageBlock = 451112 -- Não alterar este Storage local storage = 44541 local hour = 1 -- Tempo em horas que o player poderá pegar a recompensa novamente local effectChest = 10 -- Efeito Bau local itemRewardID = 2160 -- ItemID que será enviado para o depot local count = 1 -- Quantidade do Item local time = 60 * 60 * hour local messageSucess = "Voce recebeu uma recompensa do bau, ela foi enviada para o seu depot." -- mensagem que irá aparecer quando o player pegar a recompensa local messageFail = "Voce tem que esperar para poder pegar a quest novamente." -- mensagem que irá aparecer quando o player já pegou a recompensa function onUse(cid, item, fromPosition, itemEx, toPosition) local playerName = getCreatureName(cid) if (getPlayerStorageValue(cid, storage) - os.time() < storage) then local timeLeft = getPlayerStorageValue(cid, storage) - os.time() local time = { hour = math.floor(timeLeft/3600), minutes = math.ceil((timeLeft % 3600)/60) } doPlayerSendCancel(cid, messageFail) end if (getPlayerStorageValue(cid, storage) <= os.time()) then doPlayerSendMailByName(playerName, doCreateItemEx(itemRewardID, count), getPlayerTown(cid)) doSendMagicEffect(getThingPos(cid), effectChest) doPlayerSendCancel(cid,messageSucess) setPlayerStorageValue(cid, storage, os.time() + time) setPlayerStorageValue(cid, storageBlock, 1) end end
Agora vamos registrar a ActionID do baú que fará a action no arquivo actions.XML.
2 - Vá em data/actions e abra o arquivo actions.xml e cole esta tag:
<action actionid="9991" script="questDaily.lua"/>
Agora vamos configurar a mensagem que vai ser enviada para o player quando ele tiver a permissão de pegar a recompensa outra vez.
3 - Vá em data/creaturescripts/scripts, crie um arquivo lua chamado questDaily.lua:
local storage = 44541 -- Mesmo Storage que você colocou no Script do Bau (data/actions/scripts/dailyQuest.lua) local storageBlock = 451112 -- Não alterar este Storage local message = "Voce ja pode pegar a recompensa novamente." -- mensagem que será enviada quando o player tiver a permissao para pegar a recompensa novamente. function onThink(cid, interval) if(not isCreature(cid)) then return end if (os.time() == getPlayerStorageValue(cid, storage) and getPlayerStorageValue(cid, storageBlock) >= 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, message) setPlayerStorageValue(cid, storageBlock, -1) end return true end
Agora vamos registrar o evento no Creaturescripts.XML
4 - Vá em data/creaturescripts e abra o arquivo creaturescripts.xml e cole está linha:
<event type="think" name="questDaily" interval="10" event="script" value="questDaily.lua"/>
Agora vamos registrar o evento no Login.lua
5 - Vá em data/creaturescripts/login.lua e cole esta linha la dentro:
registerCreatureEvent(cid, "questDaily")
-
MatteusDeli's post in (Resolvido)KEY INTEM was marked as the answer@Vitorelias Testa ai
Crie um arquivo em data/actions/scripts chamado wallUseKey.lua
function onUse(cid, item, fromPosition, itemEx, toPosition) local position_enter = {x=138,y=52,z=7} -- posicao que o player ira ao clicar para entrar local position_exit = {x=138,y=54,z=7} -- posicao que o player vai ir quando clicar para sair local key_id = 2087 -- Id da Key para passar a parede local wall_id = 3047 -- Id da parede que o player tera que usar a key local storage_save = 56442 -- Não alterar if (itemEx.itemid == wall_id and getPlayerItemCount(cid, key_id) >= 1) then if (getPlayerStorageValue(cid, storage_save) >= 1) then doTeleportThing(cid, position_exit) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doPlayerRemoveItem(cid, key_id, 1) setPlayerStorageValue(cid, storage_save, -1) return true end doTeleportThing(cid, position_enter) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, storage_save, 1) end end
XML:
Em itemid coloque o id da key que será usada para acionar o script
<action itemid="2087" script="wallUseKey.lua"/>
-
MatteusDeli's post in (Resolvido)Item que ganha storage was marked as the answer@Vitorelias
Crie um arquivo lua na pasta data/actions/scripts com o nome de wallUse.lua
Aonde ta storage_player, você coloca a storage que o player tem que ter para dar use na parede. E aonde ta storage_set_player a storage que o player irá ganhar quando clicar na parede.
function onUse(cid, item, fromPosition, itemEx, toPosition) local storage_player = 5555 -- Storage que o player vai ter para dar USE na parede local storage_set_player = 7777 -- Storage que o player irá ganhar clicando na parede if isPlayer(cid) then if getPlayerStorageValue(cid, storage_player) >= 1 then setPlayerStorageValue(cid, storage_set_player, 1) setPlayerStorageValue(cid, storage_player, 0) else return false end end return true end XML:
<action actionid="XXXX" script="wallUse.lua"/> Aonde ta XXXX é a actionid que irá disparar o script.