TekaZudo
seuserver.com.br
DESCRIÇÃO
Anuncie aqui neste countdown e dê maior visibilidade ao seu lançamento |
Full Global • Custom Quests • Custom Outfits • Lottery System • Version 15x
Inicia em:
--
Participar
Solutions
-
machine's post in (Resolvido)Npc de SCARAB COIN was marked as the answer\data\npc\scripts crie scarabitens.lua
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 local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 2159 -- [ID DO SCARAB COIN] local t = { [1234] = {price = 15} -- [ID DO ITEM QUE SERÁ VENDIDO] = {QUANTO IRÁ CUSTAR} [5678] = {price = 15} [9101] = {price = 15} [1213] = {price = 15} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("você não tem "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("aqui está seu item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) \data\npc crie trocador.xml (ou qualquer nome que quiser, mas lembre de trocar no script abaixo também)
<?xml version="1.0"?> <npc name="Trocador" script="data/npc/scripts/scarabitens.lua" access="5" lookdir="2" walkinterval="0"> <health now="200" max="200" /> <look type="324" head="95" body="95" legs="95" feet="95" addons="3" /> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. Veio trocar uns scarabs coins por itens? Diga {trade}." /> </parameters> </npc> -
machine's post in (Resolvido)Ganha item dando use, Bugado Ajuda! was marked as the answerAlienBear obrigado mesmo por tentar ajudar, porém desse jeito ai não da.
Já resolvi o problema, o meu erro era na actions.xml
Estava usando o uniqueid=16102 que era da planta, me liguei e vi que tinha que botar o itemid=4869 da botanists container
Errado
<action uniqueid="16102" event="script" value="griffin.lua"/>
Certo
<action itemid="4869" event="script" value="griffin.lua"/>
Obs: o meu script está correto
Problema resolvido