Ir para conteúdo
  • 0

Ediar um npc de outfit-Ajudaa


kaleudd

Pergunta

I ae,gostaria que alguem modificasse como eu queria.

oq eu quero que edite?

 

Gostaria de tirar o dinheiro e botar para comprar outfit por x item e quantia.

 

Só isso obg!

 

Meu script:

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

out = {Jam = 181601, Rap = 181602, Ori = 181603, Roc = 181604, Adv = 181605, Bus = 181606, Atl = 181607, Punk = 181608, Mer = 181610, Hik = 181611}
        
        if (msgcontains(msg, 'Outfit') or msgcontains(msg, 'roupas') or msgcontains(msg, 'Outfits') or msgcontains(msg, 'outfits')) then
           selfSay("I sell this outfits Male..{Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}, which outfit do you want??", cid)
           talkState[talkUser] = 2
----Fodao
        elseif (msgcontains(msg, 'Fodao') or msgcontains(msg, 'fodao')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 3
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 3 then
        if getPlayerStorageValue(cid, out.Jam) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1562, 1)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Jam, 1)
                 else
                     doPlayerAddOutfit(cid, 1562, 1)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Jam, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 3 then
           selfSay("So... I have this other outfits {Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2
----Gordo Alto
        elseif (msgcontains(msg, 'Gordo Alto') or msgcontains(msg, 'gordo alto')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 4
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 4 then
        if getPlayerStorageValue(cid, out.Rap) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1563, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Rap, 1)
                 else
                     doPlayerAddOutfit(cid, 1563, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Rap, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 4 then
           selfSay("So... I have this other outfits {Fodao, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2
----Jogado de Basquete
        elseif (msgcontains(msg, 'Jogado de Basquete') or msgcontains(msg, 'jogado de basquete')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 5
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 5 then
        if getPlayerStorageValue(cid, out.Ori) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1568, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Ori, 1)
                 else
                     doPlayerAddOutfit(cid, 1568, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Ori, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 5 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Sktista, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2  
----Sktista
        elseif (msgcontains(msg, 'Sktista') or msgcontains(msg, 'sktista')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 6
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 6 then
        if getPlayerStorageValue(cid, out.Roc) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1569, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Roc, 1)
                 else
                     doPlayerAddOutfit(cid, 1569, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Roc, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 6 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Punk 1, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2 
----Punk 1
        elseif (msgcontains(msg, 'Punk 1') or msgcontains(msg, 'punk 1')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 7
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 7 then
        if getPlayerStorageValue(cid, out.Adv) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1570, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Adv, 1)
                 else
                     doPlayerAddOutfit(cid, 1570, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Adv, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 7 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Malandro, Negao, Novinho, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2  
----Malandro
        elseif (msgcontains(msg, 'Malandro') or msgcontains(msg, 'malandro')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 8
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 8 then
        if getPlayerStorageValue(cid, out.Bus) <= 0 then
              if getPlayerMoney(cid) >= 30000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1574, 0)
                    doPlayerRemoveMoney(cid, 30000)
                    setPlayerStorageValue(cid, out.Bus, 1)
                 else
                     doPlayerAddOutfit(cid, 1574, 0)
                     doPlayerRemoveMoney(cid, 30000)
                     setPlayerStorageValue(cid, out.Bus, 1)
                 end
              else
                  selfSay("You need 300dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Negao, Novinho, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 8 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Negao, Novinho, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2 
----Negao
        elseif (msgcontains(msg, 'Negao') or msgcontains(msg, 'negao')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 9
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 9 then
        if getPlayerStorageValue(cid, out.Atl) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1573, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Atl, 1)
                 else
                     doPlayerAddOutfit(cid, 1573, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Atl, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Novinho, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 9 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Novinho, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2  
----Novinho
        elseif (msgcontains(msg, 'Novinho') or msgcontains(msg, 'novinho')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 10
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 10 then
        if getPlayerStorageValue(cid, out.Punk) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1575, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Punk, 1)
                 else
                     doPlayerAddOutfit(cid, 1575, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Punk, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Dr House e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 10 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Dr House e Malandro Jr}.", cid)
           talkState[talkUser] = 2  
----Dr House
        elseif (msgcontains(msg, 'Dr House') or msgcontains(msg, 'dr house')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 12
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 12 then
        if getPlayerStorageValue(cid, out.Mer) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1579, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Mer, 1)
                 else
                     doPlayerAddOutfit(cid, 1579, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Mer, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Malandro Jr}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 12 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Malandro Jr}.", cid)
           talkState[talkUser] = 2
----Malandro Jr
        elseif (msgcontains(msg, 'Malandro Jr') or msgcontains(msg, 'malandro jr')) and talkState[talkUser] == 2 then 
           selfSay("Are you sure which want buy that outfit?", cid)
           talkState[talkUser] = 13
        elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 13 then
        if getPlayerStorageValue(cid, out.Hik) <= 0 then
           if getPlayerPremiumDays(cid) > 0 then
              if getPlayerMoney(cid) >= 20000 then
                 if getPlayerSex(cid) == 0 then
                    doPlayerAddOutfit(cid, 1571, 0)
                    doPlayerRemoveMoney(cid, 20000)
                    setPlayerStorageValue(cid, out.Hik, 1)
                 else
                     doPlayerAddOutfit(cid, 1571, 0)
                     doPlayerRemoveMoney(cid, 20000)
                     setPlayerStorageValue(cid, out.Hik, 1)
                 end
              else
                  selfSay("You need 200dl to buy this outfit!", cid)
                  talkState[talkUser] = 2
                  return false
              end
           else
               selfSay("Need be premium to buy this Outfit.", cid)
               talkState[talkUser] = 0
               return false
           end
        else
            selfSay("You already have this outfit, so... I have other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Dr House}.", cid)
            talkState[talkUser] = 2
            return false
        end
           selfSay("So... Here is.", cid)
        elseif (msgcontains(msg, 'no') or msgcontains(msg, 'nao')) and talkState[talkUser] == 13 then
           selfSay("So... I have this other outfits {Fodao, Gordo Alto, Jogado de Basquete, Sktista, Punk 1, Malandro, Negao, Novinho e Dr House}.", cid)
           talkState[talkUser] = 2                             
        end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())             

@up

Editado por kaleudd
Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0
  • Diretor

Boa tarde Kaleudd, simples basta substituir o doPlayerRemoveMoney(cid, 20000) por doPlayerRemoveItem(cid,ID DO ITEM,QUANTIDADE) EXEMPLO: doPlayerRemoveItem(cid,2160,100)

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...