Advertisement
Guest User

old version

a guest
Dec 5th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.99 KB | None | 0 0
  1. categories = {
  2. ["Upper Average"] = {}, --9.5%
  3. ["High"] = {}, --5%
  4. ["Best"] = {}, --.5%
  5. ["OmegaRare"] = {}
  6. }
  7.  
  8. info = { --Percent, Color, 2nd algorithm
  9. ["Upper Average"] = {23,Color3.new(59/255,134/255,134/255),14},
  10. ["High"] = {23,Color3.new(11/255,72/255,107/255),12},
  11. ["Best"] = {4,Color3.new(142/255,95/255,135/255),4},
  12. ["OmegaRare"] = {1,Color3.new(1,1,1),1}
  13. }
  14.  
  15. chances = {}
  16. fakechance = {}
  17.  
  18. pokemonshowing = {
  19. }
  20.  
  21. notAllowed = {
  22. ["Arceus"] = true,
  23. ["Heatran"] = true,
  24. ["Druddigon"] = true,
  25. ["Darumaka"] = true,
  26. ["Aegis MKII"] = true,
  27. ["Shaymin-Sky"] = true,
  28. ["?999?"] = true,
  29. ["Groundtwo"] = true,
  30. ["King_Arceus"] = true,
  31. ["BeastyBash100"] = true,
  32. ["KingGiratina"] = true,
  33. ["Rotom"] = true,
  34. ["Rotom-Wash"] = true, --Game Breaker
  35. }
  36.  
  37. rouletteOnly = {
  38. ["Sigilyph"] = true,
  39. ["Stantler"] = true,
  40. ["Ditto"] = true,
  41. ["Jirachi"] = true,
  42. ["Darmanitan"] = true,
  43. ["Chatot"] = true,
  44. ["Audino"] = true
  45. }
  46. rouletteOnlyColor = Color3.new(1,170/255,0)
  47. repeat wait() until _G.PokemonReady == true
  48. p = game.Players.LocalPlayer
  49.  
  50.  
  51. function calculatestats(table)
  52. local num = 0
  53. for _,stat in pairs(table["Stats"]) do
  54. num = num + stat
  55. end
  56. return num
  57. end
  58.  
  59. local additive = "SIFQX76BjrbKt7fpDwel"
  60.  
  61. local Pokedex
  62. for i,v in pairs(_G.Pokemon) do
  63. 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
  64. local s = calculatestats(v)
  65. local newString = i:reverse()..additive
  66. if s >= 455 and s < 525 then
  67. table.insert(categories["Upper Average"],newString)
  68. elseif s >= 525 and s < 579 then
  69. table.insert(categories["High"],newString)
  70. elseif s >= 580 and s < 601 then
  71. table.insert(categories["Best"],newString)
  72. elseif s >= 600 then
  73. table.insert(categories["OmegaRare"],newString)
  74. end
  75. end
  76. end
  77.  
  78. for i,v in pairs(info) do
  79. for val = 1, v[3] do
  80. table.insert(fakechance,i)
  81. end
  82. end
  83.  
  84. for i,v in pairs(info) do
  85. for val = 1, v[1] do
  86. table.insert(chances,i)
  87. end
  88. end
  89. --200,299,
  90.  
  91. for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
  92. if v:IsA("ImageButton") then
  93. local sec = fakechance[math.random(1,#fakechance)]
  94. local pokemonString = categories[sec][math.random(1,#categories[sec])]
  95. local count = #additive
  96. local pokemon = pokemonString:sub(1,#pokemonString-count):reverse()
  97. v.BackgroundColor3 = info[sec][2]
  98. if rouletteOnly[pokemon] then
  99. v.BackgroundColor3 = rouletteOnlyColor
  100. end
  101. v.poke.Text = pokemon
  102. local shiny = math.random(1,15)
  103. if shiny == 6 then
  104. v.Image = _G.Pokemon[pokemon]["Sprites"]["SF"]
  105. else
  106. v.Image = _G.Pokemon[pokemon]["Sprites"]["Front"]
  107. end
  108.  
  109. end
  110. end
  111.  
  112. function findbox()
  113. local numbers = {}
  114. for i,v in ipairs(game.Players.LocalPlayer.PC:GetChildren()) do
  115. if #v:GetChildren() == 0 then
  116.  
  117. return v.Name,1
  118. elseif #v:GetChildren() < 60 then
  119. for _,po in ipairs(v:GetChildren()) do
  120. numbers[po.PartyPosition.Value] = true
  121. end
  122. for swag = 1, 60 do
  123. if numbers[swag] == nil then
  124. return v.Name,swag
  125. end
  126. end
  127. end
  128. end
  129. end
  130.  
  131. function pokieget()
  132. local userteam = game.Players.LocalPlayer.PokemonParty
  133. if #userteam:GetChildren() < 6 then
  134. return #userteam:GetChildren() + 1,userteam
  135. else
  136. local newbox,number = findbox()
  137. return number,p.PC[newbox]
  138. end
  139. end
  140.  
  141. function changevals()
  142. for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
  143. if v:IsA("ImageButton") then
  144. local num = tonumber(v.Name)
  145. if num == 1 then
  146. v.Name = 5
  147. else
  148. v.Name = num - 1
  149. end
  150. end
  151. end
  152. end
  153.  
  154. function scroll(iteration)
  155. for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
  156. if v:IsA("ImageButton") then
  157. local num = tonumber(v.Name)
  158. if num == 1 then
  159.  
  160. v:TweenPosition(UDim2.new(0,1,.5,-50),"Out","Linear",.5,false,function()
  161. local sec = fakechance[math.random(1,#fakechance)]
  162. local pokemonString = categories[sec][math.random(1,#categories[sec])]
  163. local count = #additive
  164. local pokemon = pokemonString:sub(1,#pokemonString-count):reverse()
  165. v.poke.Text = pokemon
  166. v.BackgroundColor3 = info[sec][2]
  167. if rouletteOnly[pokemon] then
  168. v.BackgroundColor3 = rouletteOnlyColor
  169. end
  170. local shiny = math.random(1,15)
  171. if shiny == 6 then
  172. v.Image = _G.Pokemon[pokemon]["Sprites"]["SF"]
  173. shiny = true
  174. else
  175. shiny = false
  176. v.Image = _G.Pokemon[pokemon]["Sprites"]["Front"]
  177. end
  178. pokemonshowing[v] = {pokemon,shiny}
  179. changevals()
  180. v.Position = UDim2.new(0, 500,0.5, -50)
  181. if script.Parent.Main.UpgradedRoulette.Visible == false then
  182. return
  183. elseif selected == true then
  184. differentscroll()
  185. else
  186. scroll()
  187. end
  188. end)
  189. else
  190. v:TweenPosition(UDim2.new(0,((num-1)*100),.5,-50),"Out","Linear",.5)
  191.  
  192. end
  193. end
  194. end
  195.  
  196. end
  197.  
  198. local Math = require(game.ReplicatedStorage.Functions.Math)
  199. local Pokedex = require(game.ReplicatedStorage.Functions.Pokedex)
  200. local iterations = 0
  201. function differentscroll()
  202. if iterations <= 8 then
  203. for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
  204. if v:IsA("ImageButton") then
  205. local num = tonumber(v.Name)
  206. local timetowait = .7 + math.min(iterations^1.3/10,.3)
  207.  
  208. if num == 1 then
  209. v:TweenPosition(UDim2.new(0,0,.5,-50),"Out","Linear",timetowait,false,function()
  210. local sec = chances[math.random(1,#chances)]
  211. local pokemonString = categories[sec][math.random(1,#categories[sec])]
  212. local count = #additive
  213. local pokemon = pokemonString:sub(1,#pokemonString-count):reverse()
  214. v.poke.Text = pokemon
  215. v.BackgroundColor3 = info[sec][2]
  216. if rouletteOnly[pokemon] then
  217. v.BackgroundColor3 = rouletteOnlyColor
  218. end
  219. local shiny = math.random(1,1)
  220. if shiny == 6 then
  221. v.Image = _G.Pokemon[pokemon]["Sprites"]["SF"]
  222. shiny = true
  223. else
  224. shiny = false
  225. v.Image = _G.Pokemon[pokemon]["Sprites"]["Front"]
  226. end
  227. pokemonshowing[v] = {pokemonString,shiny}
  228. changevals()
  229. iterations = iterations + 1
  230. v.Position = UDim2.new(0, 500,0.5, -50)
  231. differentscroll()
  232. end)
  233. else
  234. v:TweenPosition(UDim2.new(0,((num-1)*100),.5,-50),"Out","Linear",(timetowait))
  235. end
  236.  
  237. end
  238. end
  239. else
  240. local randomval = math.random(10,90)
  241. for i,v in ipairs(script.Parent.Main.UpgradedRoulette:GetChildren()) do
  242. if v:IsA("ImageButton") then
  243. local num = tonumber(v.Name)
  244. local timetowait = .5+math.min(math.max((iterations/10),.5),.3)
  245. if num == 1 then
  246. v:TweenPosition(UDim2.new(0,randomval,.5,-50),"Out","Linear",timetowait,false,function()
  247. local sec = chances[math.random(1,#chances)]
  248. for i,v in pairs(pokemonshowing) do
  249. if i.Position.X.Offset > 200 and i.Position.X.Offset < 300 then
  250. local color = i.BackgroundColor3
  251. local count = #additive
  252.  
  253. if rouletteOnly[v[1]:sub(1,#v[1]-count):reverse()] then
  254. color = rouletteOnlyColor
  255. end
  256. local message = p.Name.." got "..v[1]:sub(1,#v[1]-count):reverse().." from the Pokemon Roulette!"
  257. game.ReplicatedStorage.REvents.Internal.wouoz:FireServer(message, color)
  258. local party,box = pokieget()
  259. local newpoke = _G.PlayingCheckers(v[1]:sub(1,#v[1]-count):reverse(),box,math.min(80,5 + (9*#p.Badges:GetChildren())),true)
  260. if not Pokedex:Check(newpoke.Name,p) then
  261. Pokedex:Create(newpoke.Name,true)
  262. else
  263. Pokedex:Caught(newpoke.Name)
  264. end
  265. Math:SwapParty(newpoke,party)
  266. if box.Name == "PokemonParty" then
  267. script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "You got "..v[1]:sub(1,#v[1]-count):reverse().."! It's been added to your Party."
  268. else
  269. script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "You got "..v[1]:sub(1,#v[1]-count):reverse().."! It's been added to "..box.Name.."."
  270. end
  271. game.ReplicatedStorage.GoogleAnalytics:FireServer("Roulette",newpoke.Name,p.Name,1)
  272. script.Parent.Main.UpgradedRoulette.Bottom.Result.TextTransparency = 0
  273. script.Parent.Main.UpgradedRoulette.Bottom.Result.TextStrokeTransparency = 0
  274.  
  275. end
  276. end
  277. wait(3)
  278. script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "Saving Pokemon data... remember to still save when you leave."
  279. local answer = game.ReplicatedStorage.REvents.Internal.SaveRoulette:InvokeServer()
  280. if answer == "Nothing" then
  281. _G.UpgradedRoulette()
  282. else
  283. script.Parent.Main.UpgradedRoulette.Bottom.Result.Text = "Save failed -- remember to save ASAP manually."
  284. wait(3)
  285. _G.UpgradedRoulette()
  286. end
  287. --v.Position = UDim2.new(0, 500,0.5, -50)
  288. --differentscroll()
  289. end)
  290. else
  291. v:TweenPosition(UDim2.new(0,((num-1)*100)+randomval,.5,-50),"Out","Linear",(timetowait))
  292. end
  293.  
  294. end
  295. end
  296. end
  297. end
  298. function findboxnumber()
  299. for i,v in ipairs(p.PC:GetChildren()) do
  300. if #v:GetChildren() < 60 then
  301. return true
  302. end
  303. end
  304. return false
  305. end
  306.  
  307. script.Parent.Main.UpgradedRoulette.Close.MouseButton1Down:connect(function()
  308. script.Parent.Main.BlackScreen.Visible = false
  309. script.Parent.Main.UpgradedRoulette.Visible = false
  310. end)
  311. local main = script.Parent.Main
  312.  
  313. script.Parent.Main.UpgradedRoulette.Top.Upgrade.MouseButton1Click:connect(function()
  314. _G.Roulette()
  315. end)
  316. --button event that changes selected to "true"
  317. _G.UpgradedRoulette = function(val)
  318. repeat wait() until (not main:FindFirstChild("ContinueScreen")) or (main:FindFirstChild("ContinueScreen") and main.ContinueScreen.Visible == false) and #p.PokemonParty:GetChildren() > 0
  319. script.Parent.Main.Roulette.Visible = false
  320. if event then event:disconnect() end
  321. script.Parent.Main.BlackScreen.Visible = true
  322. script.Parent.Main.UpgradedRoulette.Bottom.Roll.Visible = true
  323. script.Parent.Main.UpgradedRoulette.Bottom.Result.TextTransparency = 1
  324. script.Parent.Main.UpgradedRoulette.Bottom.Result.TextStrokeTransparency = 1
  325. if not val then
  326. selected = false
  327. iterations = 0
  328. script.Parent.Main.UpgradedRoulette.Top.Upgrade.Visible = true
  329. script.Parent.Main.UpgradedRoulette.Close.Visible = true
  330. event = script.Parent.Main.UpgradedRoulette.Bottom.Roll.MouseButton1Down:connect(function()
  331. if (#p.PokemonParty:GetChildren() < 6 or findboxnumber() == true ) then
  332. game:GetService("MarketplaceService"):PromptProductPurchase(p,917450744)
  333. end
  334.  
  335. end)
  336. scroll()
  337. else
  338. script.Parent.Main.UpgradedRoulette.Top.Upgrade.Visible = false
  339. script.Parent.Main.UpgradedRoulette.Close.Visible = false
  340. differentscroll()
  341. end
  342. script.Parent.Main.UpgradedRoulette.Visible = true
  343. end
  344.  
  345.  
  346. game.ReplicatedStorage.REvents.Pokemon.UpgradedRoulette.OnClientEvent:connect(function()
  347. if script.Parent.Main.UpgradedRoulette.Visible == false then
  348. _G.UpgradedRoulette(true)
  349. end
  350. if event then event:disconnect()end
  351. script.Parent.Main.UpgradedRoulette.Bottom.Roll.Visible = false
  352. script.Parent.Main.UpgradedRoulette.Top.Upgrade.Visible = false
  353. script.Parent.Main.UpgradedRoulette.Close.Visible = false
  354. selected = true
  355.  
  356. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement