- 0
(resolvido) Duvida Enquanto Script
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
- 2 respostas
- 724 visualizações
-
- 13 respostas
- 11566 visualizações
-
- 0 respostas
- 1633 visualizações
-
- 20 respostas
- 11338 visualizações
-
- 39 respostas
- 14309 visualizações
-
Pergunta
Josegvb 87
Tenho 2 scripts aqui, ambos entregam pro o player 1 pokemon numa ball q é UNIQUE item
queria saber ql é a linha q ta fazendo eles vir unique pois quero usar em outros scripts mas nao faço ideia de como setar uniques os pokemons
local megasStones = {15131, 15134, 15135, 15133, 15136, 15780, 15781, 15783, 15784, 15788, 15789, 15790, 15791}
local megasToPlayer = {
["Alakazite"] = {id = 15131, megaID = "", pokeName = "Alakazam"},
["Charizardite X"] = {id = 15134, megaID = "X", pokeName = "Charizard"},
["Charizardite Y"] = {id = 15135, megaID = "Y", pokeName = "Charizard"},
["Blastoisinite"] = {id = 15133, megaID = "", pokeName = "Blastoise"},
["Gengarite"] = {id = 15136, megaID = "", pokeName = "Gengar"},
["Pidgeotile"] = {id = 15791, megaID = "", pokeName = "Pidgeot"},
["Venusaurite"] = {id = 15793, megaID = "", pokeName = "Venusaur"},
["Kangaskhanite"] = {id = 15783, megaID = "", pokeName = "Kangaskhan"},
["Aerodactylite"] = {id = 15786, megaID = "", pokeName = "Aerodactyl"},
["Tyranitarite"] = {id = 15781, megaID = "", pokeName = "Tyranitar"},
["Ampharosite"] = {id = 15794, megaID = "", pokeName = "Ampharos"},
["Scizorite"] = {id = 15784, megaID = "", pokeName = "Scizor"},
["Aggronite"] = {id = 15780, megaID = "", pokeName = "Aggron"},
["Blazikenite"] = {id = 15792, megaID = "", pokeName = "Blaziken"},
["Mawlite"] = {id = 15782, megaID = "", pokeName = "Mawlite"},
["Gardevoirite"] = {id = 15785, megaID = "", pokeName = "Gardevoir"},
["Absolite"] = {id = 15787, megaID = "", pokeName = "Absol"},
["Lucarionite"] = {id = 15788, megaID = "", pokeName = "Lucario"},
["Sceptilite"] = {id = 15789, megaID = "", pokeName = "Sceptile"},
["Swampertile"] = {id = 15790, megaID = "", pokeName = "Swampert"},
}
function onSay(cid, words, param, channel)
local mega = megasStones[math.random(1, #megasStones)]
for a, b in pairs(megasToPlayer) do
if mega == b.id then
addPokeToPlayer(cid, b.pokeName, 0, nil, "yume", true, a)
break
end
end
return true
end
function getSlot(strings, slot)
local slot1, slot2, slot3 = strings:explode("|")[1], strings:explode("|")[2], strings:explode("|")[3]
local ret, flag = "", false
for a, b in pairs(fotos) do
if getPortraitClientID(a) == tonumber(slot1) and slot == 1 then
ret = doCorrectString(a)
flag = true
elseif getPortraitClientID(a) == tonumber(slot2) and slot == 2 then
ret = doCorrectString(a)
flag = true
elseif getPortraitClientID(a) == tonumber(slot3) and slot == 3 then
ret = doCorrectString(a)
flag = true
end
if flag then
break
end
end
return ret
end
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
msg = string.lower(msg)
--\\
local need = {
--item id....quantidade
{id = 11445, qt = 100},
{id = 11445, qt = 100},
{id = 12581, qt = 1},
}
local storage = 1234 -- nem mexe
local pokemon = "Shiny Onix" -- nome do poke q vai ganha..lembrando que n tenho 100% q vai funfa ;x
--//
if msgcontains(string.lower(msg), 'city') or msgcontains(string.lower(msg), 'help') then
if getPlayerStorageValue(cid, storage) == 1 then
selfSay("você já completou minha quest!", cid)
return true
end
--//
selfSay("Hey! Would you like to revive your Onix? if so I would need an {Crystal Tail and 200 Crystal Stone Stones }!", cid)
talkState[talkUser] = 2
return true
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
if getPlayerItemCount(cid, need[1].id) < need[1].qt or getPlayerItemCount(cid, need[2].id) < need[2].qt or getPlayerItemCount(cid, need[3].id) < need [3].qt then
selfSay("você não tem todos itens necessaríos que eu pedi, volte aqui quando tive-los todos!", cid)
return true
end
for i = 1, #need do
doPlayerRemoveItem(cid, need.id, need.qt)
end
addPokeToPlayer(cid, pokemon, 0, 1, 'normal', true)
selfSay("nossa muito bom, obrigado e faça um bom proveito do seu novo pokémon!", cid)
setPlayerStorageValue(cid, storage, 1)
talkState[talkUser] = 0
return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Link para o comentário
Compartilhar em outros sites
14 respostass a esta questão
Posts Recomendados