Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- categories = {
- ["Upper Average"] = {}, --9.5%
- ["High"] = {}, --5%
- ["Best"] = {}, --.5%
- ["OmegaRare"] = {}
- }
- info = { --Percent, Color, 2nd algorithm
- ["Upper Average"] = {23,Color3.new(59/255,134/255,134/255),14},
- ["High"] = {23,Color3.new(11/255,72/255,107/255),12},
- ["Best"] = {4,Color3.new(142/255,95/255,135/255),4},
- ["OmegaRare"] = {1,Color3.new(1,1,1),1}
- }
- chances = {}
- fakechance = {}
- pokemonshowing = {
- }
- notAllowed = {
- ["Arceus"] = true,
- ["Heatran"] = true,
- ["Druddigon"] = true,
- ["Darumaka"] = true,
- ["Aegis MKII"] = true,
- ["Shaymin-Sky"] = true,
- ["?999?"] = true,
- ["Groundtwo"] = true,
- ["King_Arceus"] = true,
- ["BeastyBash100"] = true,
- ["KingGiratina"] = true,
- ["Rotom"] = true,
- ["Rotom-Wash"] = true, --Game Breaker
- }
- rouletteOnly = {
- ["Sigilyph"] = true,
- ["Stantler"] = true,
- ["Ditto"] = true,
- ["Jirachi"] = true,
- ["Darmanitan"] = true,
- ["Chatot"] = true,
- ["Audino"] = true
- }
- rouletteOnlyColor = Color3.new(1,170/255,0)
- repeat wait() until _G.PokemonReady == true
- p = game.Players.LocalPlayer
- function calculatestats(table)
- local num = 0
- for _,stat in pairs(table["Stats"]) do
- num = num + stat
- end
- return num
- end
- local additive = "SIFQX76BjrbKt7fpDwel"
- local Pokedex
- for i,v in pairs(_G.Pokemon) do
- if v["Mega"] == nil and i ~= "Mewthree, Swag Prince" and i ~= "MechaMewtwo" and not i:lower():match("zombie") and not i:match("Deoxys") and not i:match("Rotom") and not notAllowed[i] then
- local s = calculatestats(v)
- local newString = i:reverse()..additive
- if s >= 455 and s < 525 then
- table.insert(categories["Upper Average"],newString)
- elseif s >= 525 and s < 579 then
- table.insert(categories["High"],newString)
- elseif s >= 580 and s < 601 then
- table.insert(categories["Best"],newString)
- elseif s >= 600 then
- table.insert(categories["OmegaRare"],newString)
- end
- end
- end
- for i,v in pairs(info) do
- for val = 1, v[3] do
- table.insert(fakechance,i)
- end
- end
- for i,v in pairs(info) do
- for val = 1, v[1] do
- table.insert(chances,i)
- end
- end
- --200,299,
- for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
- if v:IsA("ImageButton") then
- local sec = fakechance[math.random(1,#fakechance)]
- local pokemonString = categories[sec][math.random(1,#categories[sec])]
- local count = #additive
- local pokemon = pokemonString:sub(1,#pokemonString-count):reverse()
- v.BackgroundColor3 = info[sec][2]
- if rouletteOnly[pokemon] then
- v.BackgroundColor3 = rouletteOnlyColor
- end
- v.poke.Text = pokemon
- local shiny = math.random(1,15)
- if shiny == 6 then
- v.Image = _G.Pokemon[pokemon]["Sprites"]["SF"]
- else
- v.Image = _G.Pokemon[pokemon]["Sprites"]["Front"]
- end
- end
- end
- function findbox()
- local numbers = {}
- for i,v in ipairs(game.Players.LocalPlayer.PC:GetChildren()) do
- if #v:GetChildren() == 0 then
- return v.Name,1
- elseif #v:GetChildren() < 60 then
- for _,po in ipairs(v:GetChildren()) do
- numbers[po.PartyPosition.Value] = true
- end
- for swag = 1, 60 do
- if numbers[swag] == nil then
- return v.Name,swag
- end
- end
- end
- end
- end
- function pokieget()
- local userteam = game.Players.LocalPlayer.PokemonParty
- if #userteam:GetChildren() < 6 then
- return #userteam:GetChildren() + 1,userteam
- else
- local newbox,number = findbox()
- return number,p.PC[newbox]
- end
- end
- function changevals()
- for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
- if v:IsA("ImageButton") then
- local num = tonumber(v.Name)
- if num == 1 then
- v.Name = 5
- else
- v.Name = num - 1
- end
- end
- end
- end
- function scroll(iteration)
- for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
- if v:IsA("ImageButton") then
- local num = tonumber(v.Name)
- if num == 1 then
- v:TweenPosition(UDim2.new(0,1,.5,-50),"Out","Linear",.5,false,function()
- local sec = fakechance[math.random(1,#fakechance)]
- local pokemonString = categories[sec][math.random(1,#categories[sec])]
- local count = #additive
- local pokemon = pokemonString:sub(1,#pokemonString-count):reverse()
- v.poke.Text = pokemon
- v.BackgroundColor3 = info[sec][2]
- if rouletteOnly[pokemon] then
- v.BackgroundColor3 = rouletteOnlyColor
- end
- local shiny = math.random(1,15)
- if shiny == 6 then
- v.Image = _G.Pokemon[pokemon]["Sprites"]["SF"]
- shiny = true
- else
- shiny = false
- v.Image = _G.Pokemon[pokemon]["Sprites"]["Front"]
- end
- pokemonshowing[v] = {pokemon,shiny}
- changevals()
- v.Position = UDim2.new(0, 500,0.5, -50)
- if script.Parent.Main.UpgradedRoulette.Visible == false then
- return
- elseif selected == true then
- differentscroll()
- else
- scroll()
- end
- end)
- else
- v:TweenPosition(UDim2.new(0,((num-1)*100),.5,-50),"Out","Linear",.5)
- end
- end
- end
- end
- local Math = require(game.ReplicatedStorage.Functions.Math)
- local Pokedex = require(game.ReplicatedStorage.Functions.Pokedex)
- local iterations = 0
- function differentscroll()
- if iterations <= 8 then
- for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
- if v:IsA("ImageButton") then
- local num = tonumber(v.Name)
- local timetowait = .7 + math.min(iterations^1.3/10,.3)
- if num == 1 then
- v:TweenPosition(UDim2.new(0,0,.5,-50),"Out","Linear",timetowait,false,function()
- local sec = chances[math.random(1,#chances)]
- local pokemonString = categories[sec][math.random(1,#categories[sec])]
- local count = #additive
- local pokemon = pokemonString:sub(1,#pokemonString-count):reverse()
- v.poke.Text = pokemon
- v.BackgroundColor3 = info[sec][2]
- if rouletteOnly[pokemon] then
- v.BackgroundColor3 = rouletteOnlyColor
- end
- local shiny = math.random(1,1)
- if shiny == 6 then
- v.Image = _G.Pokemon[pokemon]["Sprites"]["SF"]
- shiny = true
- else
- shiny = false
- v.Image = _G.Pokemon[pokemon]["Sprites"]["Front"]
- end
- pokemonshowing[v] = {pokemonString,shiny}
- changevals()
- iterations = iterations + 1
- v.Position = UDim2.new(0, 500,0.5, -50)
- differentscroll()
- end)
- else
- v:TweenPosition(UDim2.new(0,((num-1)*100),.5,-50),"Out","Linear",(timetowait))
- end
- end
- end
- else
- local randomval = math.random(10,90)
- for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
- if v:IsA("ImageButton") then
- local num = tonumber(v.Name)
- local timetowait = .5+math.min(math.max((iterations/10),.5),.3)
- if num == 1 then
- v:TweenPosition(UDim2.new(0,randomval,.5,-50),"Out","Linear",timetowait,false,function()
- local sec = chances[math.random(1,#chances)]
- for i,v in pairs(pokemonshowing) do
- if i.Position.X.Offset > 200 and i.Position.X.Offset < 300 then
- local color = i.BackgroundColor3
- local count = #additive
- if rouletteOnly[v[1]:sub(1,#v[1]-count):reverse()] then
- color = rouletteOnlyColor
- end
- local message = p.Name.." got "..v[1]:sub(1,#v[1]-count):reverse().." from the Pokemon Roulette!"
- game.ReplicatedStorage.REvents.Internal.wouoz:FireServer(message, color)
- local party,box = pokieget()
- local newpoke = _G.PlayingCheckers(v[1]:sub(1,#v[1]-count):reverse(),box,math.min(80,5 + (9*#p.Badges:GetChildren())),true)
- if not Pokedex:Check(newpoke.Name,p) then
- Pokedex:Create(newpoke.Name,true)
- else
- Pokedex:Caught(newpoke.Name)
- end
- Math:SwapParty(newpoke,party)
- if box.Name == "PokemonParty" then
- script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "You got "..v[1]:sub(1,#v[1]-count):reverse().."! It's been added to your Party."
- else
- script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "You got "..v[1]:sub(1,#v[1]-count):reverse().."! It's been added to "..box.Name.."."
- end
- game.ReplicatedStorage.GoogleAnalytics:FireServer("Roulette",newpoke.Name,p.Name,1)
- script.Parent.Main.UpgradedRoulette.Bottom.Result.TextTransparency = 0
- script.Parent.Main.UpgradedRoulette.Bottom.Result.TextStrokeTransparency = 0
- end
- end
- wait(3)
- script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "Saving Pokemon data... remember to still save when you leave."
- local answer = game.ReplicatedStorage.REvents.Internal.SaveRoulette:InvokeServer()
- if answer == "Nothing" then
- _G.UpgradedRoulette()
- else
- script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "Save failed -- remember to save ASAP manually."
- wait(3)
- _G.UpgradedRoulette()
- end
- --v.Position = UDim2.new(0, 500,0.5, -50)
- --differentscroll()
- end)
- else
- v:TweenPosition(UDim2.new(0,((num-1)*100)+randomval,.5,-50),"Out","Linear",(timetowait))
- end
- end
- end
- end
- end
- function findboxnumber()
- for i,v in ipairs(p.PC:GetChildren()) do
- if #v:GetChildren() < 60 then
- return true
- end
- end
- return false
- end
- script.Parent.Main.UpgradedRoulette.Close.MouseButton1Down:connect(function()
- script.Parent.Main.BlackScreen.Visible = false
- script.Parent.Main.UpgradedRoulette.Visible = false
- end)
- local main = script.Parent.Main
- script.Parent.Main.UpgradedRoulette.Top.Upgrade.MouseButton1Click:connect(function()
- _G.Roulette()
- end)
- --button event that changes selected to "true"
- _G.UpgradedRoulette = function(val)
- repeat wait() until (not main:FindFirstChild("ContinueScreen")) or (main:FindFirstChild("ContinueScreen") and main.ContinueScreen.Visible == false) and #p.PokemonParty:GetChildren() > 0
- script.Parent.Main.Roulette.Visible = false
- if event then event:disconnect() end
- script.Parent.Main.BlackScreen.Visible = true
- script.Parent.Main.UpgradedRoulette.Bottom.Roll.Visible = true
- script.Parent.Main.UpgradedRoulette.Bottom.Result.TextTransparency = 1
- script.Parent.Main.UpgradedRoulette.Bottom.Result.TextStrokeTransparency = 1
- if not val then
- selected = false
- iterations = 0
- script.Parent.Main.UpgradedRoulette.Top.Upgrade.Visible = true
- script.Parent.Main.UpgradedRoulette.Close.Visible = true
- event = script.Parent.Main.UpgradedRoulette.Bottom.Roll.MouseButton1Down:connect(function()
- if (#p.PokemonParty:GetChildren() < 6 or findboxnumber() == true ) then
- game:GetService("MarketplaceService"):PromptProductPurchase(p,917450744)
- end
- end)
- scroll()
- else
- script.Parent.Main.UpgradedRoulette.Top.Upgrade.Visible = false
- script.Parent.Main.UpgradedRoulette.Close.Visible = false
- differentscroll()
- end
- script.Parent.Main.UpgradedRoulette.Visible = true
- end
- game.ReplicatedStorage.REvents.Pokemon.UpgradedRoulette.OnClientEvent:connect(function()
- if script.Parent.Main.UpgradedRoulette.Visible == false then
- _G.UpgradedRoulette(true)
- end
- if event then event:disconnect()end
- script.Parent.Main.UpgradedRoulette.Bottom.Roll.Visible = false
- script.Parent.Main.UpgradedRoulette.Top.Upgrade.Visible = false
- script.Parent.Main.UpgradedRoulette.Close.Visible = false
- selected = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement