Advertisement
IHATEMICROWAVEOVEN

for analyzing lol

Apr 3rd, 2022
133
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 121.97 KB | None | 0 0
  1. local Configuration = require(script:WaitForChild("Config"))
  2. local Stats = require(game:GetService("Players").LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("Stats"))
  3.  
  4. function ReturnConf(CNAME)
  5. if Configuration[CNAME] ~= nil then
  6. return Configuration[CNAME]
  7. end
  8. end
  9.  
  10. game.ReplicatedFirst:RemoveDefaultLoadingScreen()
  11. local function wait(waittime)
  12. local waittime = waittime
  13. if waittime == nil then
  14. waittime = 0.01
  15. end
  16. local starttime = tick()
  17. repeat game:GetService("RunService").Stepped:wait() until tick() >= starttime+waittime
  18. end
  19.  
  20. --game:GetService("GuiService").AutoSelectGuiEnabled = false
  21. --game:GetService("GuiService").GuiNavigationEnabled = false
  22. --game:GetService("GuiService").CoreGuiNavigationEnabled = false
  23. game:GetService("UserInputService").ModalEnabled = true
  24.  
  25. local mobileinterface = game:GetService("UserInputService").TouchEnabled
  26.  
  27. script.Parent.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  28.  
  29. local PokemonDatas
  30.  
  31. local gui = script.Parent
  32. local IntroShown = _G.IntroShown
  33.  
  34. script:WaitForChild("Pokemon")
  35. local mods = require(script:WaitForChild("Encoder"))
  36. local mod = mods["GetFromCode"]
  37. local mod2 = mods["GetOR"]
  38.  
  39. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
  40. local inf = gui.Intro
  41. local event = game.ReplicatedStorage.FUNCTION
  42.  
  43. function CallServer(...)
  44. return event:InvokeServer(...)
  45. end
  46.  
  47. --[[
  48. local LogService = game:GetService("LogService")
  49. LogService.MessageOut:connect(function(Msg, Type)
  50. CallServer("ReportIssue", Type, Msg)
  51. end)
  52. ]]
  53.  
  54. CallServer("IsBanned")
  55.  
  56. local Anim2Running = true
  57.  
  58. local function GetDayState()
  59. local Minutes = game:GetService("Lighting"):GetMinutesAfterMidnight()
  60. if Minutes >= 0 and Minutes < 3 * 60 then
  61. return "Night"
  62. elseif Minutes >= 3 * 60 and Minutes < 6 * 60 then
  63. return "Late Night"
  64. elseif Minutes >= 6 * 60 and Minutes < 9 * 60 then
  65. return "Morning"
  66. elseif Minutes >= 9 * 60 and Minutes < 12 * 60 then
  67. return "Late Morning"
  68. elseif Minutes >= 12 * 60 and Minutes < 15 * 60 then
  69. return "Afternoon"
  70. elseif Minutes >= 15 * 60 and Minutes < 18 * 60 then
  71. return "Late Afternoon"
  72. elseif Minutes >= 18 * 60 and Minutes < 21 * 60 then
  73. return "Evening"
  74. elseif Minutes >= 21 * 60 and Minutes < 24 * 60 then
  75. return "Late Evening"
  76. end
  77. end
  78.  
  79. local function RunAnim2()
  80.  
  81. spawn(function()
  82. while Anim2Running do
  83. for _, i in pairs(script.Parent.Intro.AnimFrame:GetChildren()) do
  84. local CurrentState = GetDayState()
  85. if i.Image ~= ReturnConf("BackgroundImage")[CurrentState] then
  86. i.Image = ReturnConf("BackgroundImage")[CurrentState]
  87. end
  88. i.Position = i.Position - UDim2.new(0.0025, 0, 0, 0)
  89. if i.Position.X.Scale <= -0.99 then
  90. i.Position = UDim2.new(1, 0, 0, 0)
  91. end
  92. end
  93. game:GetService("RunService").RenderStepped:wait()
  94. end
  95. end)
  96. end
  97.  
  98. RunAnim2()
  99.  
  100. if not IntroShown then
  101.  
  102.  
  103. local loading = true
  104.  
  105. inf.Visible = true
  106.  
  107. wait(1)
  108.  
  109. inf.Logo:TweenPosition(UDim2.new(0.18, 0, 0.55, 0), "Out", "Quad", 1, true)
  110. inf.Text:TweenPosition(UDim2.new(0.1, 0, 0.8, 0), "Out", "Quad", 1, true)
  111. inf.Loading:TweenPosition(UDim2.new(0.5, -25, 0.9, -25), "Out", "Quad", 1, true)
  112.  
  113. spawn(function()
  114. while loading do
  115. inf.Loading.Rotation = inf.Loading.Rotation + 30
  116. wait(0.075)
  117. end
  118. end)
  119.  
  120. local rate = 0
  121.  
  122. spawn(function() -- Status
  123. inf.Text.Text = "Loading assets..."
  124. wait(1)
  125. while rate ~= 100 do
  126. if rate > 0 then
  127. inf.Text.Text = math.floor(tostring(rate)).."%"
  128. else
  129. inf.Text.Text = "0%"
  130. end
  131. wait()
  132. end
  133. inf.Text.Text = tostring(rate).."%"
  134. end)
  135.  
  136. local assets = {}
  137.  
  138. function Scan(location)
  139. for _, i in pairs(location:GetChildren()) do
  140. if i:IsA'ImageLabel' then
  141. table.insert(assets, i.Image)
  142. elseif i:IsA'ImageButton' then
  143. table.insert(assets, i.Image)
  144. elseif i:IsA'Tool' then
  145. table.insert(assets, i.TextureId)
  146. elseif i:IsA'Animation' then
  147. table.insert(assets, i.AnimationId)
  148. elseif i:IsA'Sound' then
  149. table.insert(assets, i.SoundId)
  150. elseif i.Name == "ImageId" then
  151. table.insert(assets, i.Value)
  152. end
  153. Scan(i)
  154. end
  155. end
  156.  
  157. Scan(game.Players.LocalPlayer)
  158.  
  159. local assets_c = #assets
  160. local assets_l = 0
  161.  
  162. for _, i in pairs(assets) do
  163. if string.sub(i, 1, 13) == "rbxassetid://" then
  164. game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..string.sub(i, 14))
  165. elseif string.sub(i, 1, 32) == "http://www.roblox.com/asset/?id=" then
  166. game:GetService("ContentProvider"):Preload(i)
  167. elseif string.sub(i, 1, 11) == "rbxasset://" then
  168. game:GetService("ContentProvider"):Preload(i)
  169. elseif i ~= "" then
  170. game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..i)
  171. end
  172. end
  173. while (game:GetService("ContentProvider").RequestQueueSize > 0) do
  174. assets_l = assets_c - game:GetService("ContentProvider").RequestQueueSize
  175. local dot = string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 > 0 and string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 or 3
  176. rate = tonumber(string.sub(tostring(( assets_l / assets_c ) * 100), 1, dot))
  177. wait()
  178. end
  179. assets_l = assets_c - game:GetService("ContentProvider").RequestQueueSize
  180. local dot = string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 > 0 and string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 or 3
  181. rate = tonumber(string.sub(tostring(( assets_l / assets_c ) * 100), 1, dot))
  182.  
  183. loading = false
  184.  
  185. wait(0.5)
  186.  
  187. inf.Loading:TweenPosition(UDim2.new(0.5, -25, 1.17, -25), "Out", "Quad", 1, true)
  188. inf.Logo:TweenPosition(UDim2.new(0.18, 0, 0.15, 0), "Out", "Quad", 1, true)
  189. inf.Text:TweenPosition(UDim2.new(0.1, 0, 1.07, 0), "Out", "Quad", 1, true)
  190.  
  191. wait(1)
  192.  
  193. _G.IntroShown = true
  194.  
  195.  
  196. end
  197.  
  198. inf.Loading:Destroy()
  199. inf.Logo:Destroy()
  200. inf.Text:Destroy()
  201. wait(1)
  202.  
  203. function SetupHUD(cc, cp)
  204. wait(0.05)
  205.  
  206. game.Players.LocalPlayer.Character:WaitForChild("WaterGravity").Disabled = false
  207.  
  208. -- ACCEPTATION SERVICE
  209.  
  210. local OnAcceptation = nil
  211. local accfuncid = 0
  212.  
  213. local function CheckAcceptionSupport()
  214. return (CallServer("GetStat", "ChatAcceptations") == 1)
  215. end
  216.  
  217. local function AddOnAcception(func, notification)
  218. OnAcceptation = func
  219. CallServer("SENDACCEPTATION", notification)
  220. accfuncid = accfuncid + 1
  221. return accfuncid
  222. end
  223. local function ResetOnAcceptation()
  224. OnAcceptation = nil
  225. accfuncid = accfuncid + 1
  226. end
  227.  
  228. local function OnAccepted(state)
  229. if OnAcceptation then
  230. return OnAcceptation(state)
  231. end
  232. return "There arent any action to accept!"
  233. end
  234.  
  235.  
  236. if not mobileinterface then
  237. script.Parent.InfoBar.Size = UDim2.new(0.2, 0, 0.15, 0)
  238. script.Parent.HideBar.Size = UDim2.new(0.161, 0, 0.15, 0)
  239. script.Parent.Expand.Size = UDim2.new(0.06, 0, 0.15, 0)
  240. script.Parent.InfoBar.Position = UDim2.new(0, 0, -0.5, 0)
  241. script.Parent.HideBar.Position = UDim2.new(0.04, 0, -0.5, 0)
  242. script.Parent.Expand.Position = UDim2.new(0.18, 0, -0.5, 0)
  243. end
  244.  
  245. local openedframe = ""
  246.  
  247. local FirstShopSettings = {}
  248. local Settings = {"BorderColor3", "BorderSizePixel", "BackgroundColor3", "BackgroundTransparency", "TextColor3", "TextTransparency", "TextStrokeColor3", "TextStrokeTransparency"}
  249.  
  250. local function Shop_AddToList(thing)
  251. for _, i in pairs(Settings) do
  252. local canapply = true
  253. if string.sub(i, 1, 4) == "Text" then
  254. if string.sub(thing.ClassName, 1, 4) ~= "Text" then
  255. canapply = false
  256. end
  257. end
  258. if canapply then
  259. local name = nil
  260. if type(thing[i]) == "userdata" then
  261. name = tostring(thing[i].r)..";"..tostring(thing[i].g)..";"..tostring(thing[i].b)
  262. else
  263. name = thing[i]
  264. end
  265. if FirstShopSettings[i] == nil then FirstShopSettings[i] = {} end
  266. if FirstShopSettings[i][name] == nil then FirstShopSettings[i][name] = {} end
  267. table.insert(FirstShopSettings[i][name], thing)
  268. end
  269. end
  270. end
  271.  
  272. local function Shop_LoadOrgSettings()
  273. for setting, v in pairs(FirstShopSettings) do
  274. for value, v2 in pairs(v) do
  275. for _, part in pairs(v2) do
  276. local r, g, b = string.match(value, "(.+);(.+);(.+)")
  277. if r ~= nil and g ~= nil and b ~= nil then
  278. part[setting] = Color3.new(tonumber(r), tonumber(g), tonumber(b))
  279. else
  280. part[setting] = value
  281. end
  282. end
  283. end
  284. end
  285. end
  286.  
  287. for _, i in pairs(script.Parent.Shop:GetChildren()) do
  288. Shop_AddToList(i)
  289. end
  290. Shop_AddToList(script.Parent.Shop)
  291.  
  292.  
  293. script.Parent.Shop.Exit.MouseButton1Click:connect(function()
  294. script.Parent.Shop:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  295. if openedframe == "SHOP" then
  296. if game.Players.LocalPlayer.Character then
  297. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  298. game.Players.LocalPlayer.Character.Torso.Anchored = false
  299. end
  300. end
  301. openedframe = ""
  302. end
  303. end)
  304.  
  305. function SetupShop(name)
  306. local data = script.Shops:FindFirstChild(name)
  307. local shopframe = script.Parent.Shop
  308. if data then
  309. for _, i in pairs(shopframe.Things:GetChildren()) do
  310. i:Destroy()
  311. end
  312. shopframe.Image.Image = "rbxassetid://"..tostring(data.Image.Value)
  313. shopframe.Quote.Text = data.Quote.Value
  314. shopframe.SName.Text = data.SName.Value
  315. local categories = {}
  316. for _, i in pairs(data:GetChildren()) do
  317. if i:IsA'Folder' then
  318. table.insert(categories, i)
  319. end
  320. end
  321. if #categories ~= 0 then
  322. local x = 1 / #categories
  323. for a, i in pairs(categories) do
  324. local TB = Instance.new("TextLabel", shopframe.Things)
  325. TB.Text = i.Name
  326. TB.Name = i.Name
  327. TB.BackgroundTransparency = 1
  328. TB.Size = UDim2.new(x, 0, 0.1, 0)
  329. TB.Position = UDim2.new(x * (a - 1), 0, 0, 0)
  330. TB.Font = Enum.Font.ArialBold
  331. TB.TextScaled = true
  332. TB.TextColor3 = Color3.new(1,1,1)
  333. local CG = Instance.new("ScrollingFrame", shopframe.Things)
  334. CG.BackgroundTransparency = 1
  335. CG.Name = i.Name
  336. CG.Position = UDim2.new(x * (a - 1), 0, 0.1, 0)
  337. CG.Size = UDim2.new(x, 0, 0.9, 0)
  338. CG.BorderSizePixel = 0
  339. -- BUTTON CREATION
  340. local y = 1 / #i:GetChildren()
  341. if #i:GetChildren() <= 5 then
  342. y = 0.2
  343. end
  344. for num, but in pairs(i:GetChildren()) do
  345. local B = Instance.new("TextButton", CG)
  346. B.Text = "Loading"
  347. B.Name = but.Name
  348. B.Position = UDim2.new(0.15, 0, y * (num - 1) + (y / 4), 0)
  349. B.Size = UDim2.new(0.7, 0, y - (y / 4), 0)
  350. B.BorderColor3 = Color3.new(0, 0, 0)
  351. B.BorderSizePixel = 2
  352. B.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
  353. B.TextColor3 = Color3.new(1,1,1)
  354. B.TextScaled = true
  355. B.Font = Enum.Font.Arial
  356. -- SETUPPING
  357. require(but)(B, game.Players.LocalPlayer, CallServer)
  358. if 0.2 * num + 0.05 < 1 then
  359. CG.CanvasSize = UDim2.new(0, 0, 0, 0)
  360. else
  361. CG.CanvasSize = UDim2.new(0, 0, (0.15 * num) + 0.05, 0)
  362. end
  363. end
  364. end
  365. end
  366. -- LOADING CUSTOMIZING SCRIPT
  367. Shop_LoadOrgSettings()
  368. if data:FindFirstChild("CustomizingScript") then
  369. local function SetSetting(part, setting, newvalue)
  370. local canapply = true
  371. if string.sub(setting, 1, 4) == "Text" then
  372. if string.sub(part.ClassName, 1, 4) ~= "Text" then
  373. canapply = false
  374. end
  375. end
  376. if canapply then
  377. part[setting] = newvalue
  378. end
  379. end
  380. local configuration = require(data["CustomizingScript"])
  381. if configuration["BorderColor"] then
  382. SetSetting(shopframe, "BorderColor3", configuration["BorderColor"])
  383. for _, i in pairs(shopframe:GetChildren()) do
  384. if i:IsA'Frame' then
  385. for _, o in pairs(i:GetChildren()) do
  386. SetSetting(o, "BorderColor3", configuration["BorderColor"])
  387. end
  388. end
  389. SetSetting(i, "BorderColor3", configuration["BorderColor"])
  390. end
  391. end
  392. if configuration["BorderSize"] then
  393. SetSetting(shopframe, "BorderSizePixel", configuration["BorderSize"])
  394. for _, i in pairs(shopframe:GetChildren()) do
  395. if i:IsA'Frame' then
  396. for _, o in pairs(i:GetChildren()) do
  397. SetSetting(o, "BorderSizePixel", configuration["BorderSize"])
  398. end
  399. end
  400. SetSetting(i, "BorderSizePixel", configuration["BorderSize"])
  401. end
  402. end
  403. if configuration["BackgroundColor"] then
  404. SetSetting(shopframe, "BackgroundColor3", configuration["BackgroundColor"])
  405. for _, i in pairs(shopframe:GetChildren()) do
  406. if i:IsA'Frame' then
  407. for _, o in pairs(i:GetChildren()) do
  408. SetSetting(o, "BackgroundColor3", configuration["BackgroundColor"])
  409. end
  410. end
  411. SetSetting(i, "BackgroundColor3", configuration["BackgroundColor"])
  412. end
  413. end
  414. if configuration["BackgroundTransparency"] then
  415. SetSetting(shopframe, "BackgroundTransparency", configuration["BackgroundTransparency"])
  416. for _, i in pairs(shopframe:GetChildren()) do
  417. if i:IsA'Frame' then
  418. for _, o in pairs(i:GetChildren()) do
  419. SetSetting(o, "BackgroundTransparency", configuration["BackgroundTransparency"])
  420. end
  421. end
  422. SetSetting(i, "BackgroundTransparency", configuration["BackgroundTransparency"])
  423. end
  424. end
  425. if configuration["TextColor"] then
  426. SetSetting(shopframe, "TextColor3", configuration["TextColor"])
  427. for _, i in pairs(shopframe:GetChildren()) do
  428. if i:IsA'Frame' then
  429. for _, o in pairs(i:GetChildren()) do
  430. SetSetting(o, "TextColor3", configuration["TextColor"])
  431. end
  432. end
  433. SetSetting(i, "TextColor3", configuration["TextColor"])
  434. end
  435. end
  436. if configuration["TextTransparency"] then
  437. SetSetting(shopframe, "TextTransparency", configuration["TextTransparency"])
  438. for _, i in pairs(shopframe:GetChildren()) do
  439. if i:IsA'Frame' then
  440. for _, o in pairs(i:GetChildren()) do
  441. SetSetting(o, "TextTransparency", configuration["TextTransparency"])
  442. end
  443. end
  444. SetSetting(i, "TextTransparency", configuration["TextTransparency"])
  445. end
  446. end
  447. if configuration["TextStrokeColor"] then
  448. SetSetting(shopframe, "TextStrokeColor3", configuration["TextStrokeColor"])
  449. for _, i in pairs(shopframe:GetChildren()) do
  450. if i:IsA'Frame' then
  451. for _, o in pairs(i:GetChildren()) do
  452. SetSetting(o, "TextStrokeColor3", configuration["TextStrokeColor"])
  453. end
  454. end
  455. SetSetting(i, "TextStrokeColor3", configuration["TextStrokeColor"])
  456. end
  457. end
  458. if configuration["TextStrokeTransparency"] then
  459. SetSetting(shopframe, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
  460. for _, i in pairs(shopframe:GetChildren()) do
  461. if i:IsA'Frame' then
  462. for _, o in pairs(i:GetChildren()) do
  463. SetSetting(o, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
  464. end
  465. end
  466. SetSetting(i, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
  467. end
  468. end
  469. end
  470. return true
  471. end
  472. return false
  473. end
  474.  
  475. local FirstQuestsSettings = {}
  476. local Settings = {"BorderColor3", "BorderSizePixel", "BackgroundColor3", "BackgroundTransparency", "TextColor3", "TextTransparency", "TextStrokeColor3", "TextStrokeTransparency"}
  477.  
  478. local function Quests_AddToList(thing)
  479. for _, i in pairs(Settings) do
  480. local canapply = true
  481. if string.sub(i, 1, 4) == "Text" then
  482. if string.sub(thing.ClassName, 1, 4) ~= "Text" then
  483. canapply = false
  484. end
  485. end
  486. if canapply then
  487. local name = nil
  488. if type(thing[i]) == "userdata" then
  489. name = tostring(thing[i].r)..";"..tostring(thing[i].g)..";"..tostring(thing[i].b)
  490. else
  491. name = thing[i]
  492. end
  493. if FirstQuestsSettings[i] == nil then FirstQuestsSettings[i] = {} end
  494. if FirstQuestsSettings[i][name] == nil then FirstQuestsSettings[i][name] = {} end
  495. table.insert(FirstQuestsSettings[i][name], thing)
  496. end
  497. end
  498. end
  499.  
  500. local function Quests_LoadOrgSettings()
  501. for setting, v in pairs(FirstQuestsSettings) do
  502. for value, v2 in pairs(v) do
  503. for _, part in pairs(v2) do
  504. local r, g, b = string.match(value, "(.+);(.+);(.+)")
  505. if r ~= nil and g ~= nil and b ~= nil then
  506. part[setting] = Color3.new(tonumber(r), tonumber(g), tonumber(b))
  507. else
  508. part[setting] = value
  509. end
  510. end
  511. end
  512. end
  513. end
  514.  
  515. for _, i in pairs(script.Parent.Shop:GetChildren()) do
  516. Quests_AddToList(i)
  517. end
  518. Quests_AddToList(script.Parent.Quests)
  519.  
  520. script.Parent.Quests.Exit.MouseButton1Click:connect(function()
  521. script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  522. if openedframe == "QUESTS" then
  523. if game.Players.LocalPlayer.Character then
  524. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  525. game.Players.LocalPlayer.Character.Torso.Anchored = false
  526. end
  527. end
  528. openedframe = ""
  529. end
  530. end)
  531.  
  532. function SetupQuest(name)
  533. local data = script.Quests:FindFirstChild(name)
  534. local questframe = script.Parent.Quests
  535. if data then
  536. for _, i in pairs(questframe.Things.Quests.Quests:GetChildren()) do
  537. i:Destroy()
  538. end
  539. for _, i in pairs(questframe.Things.Milestones.Milestones:GetChildren()) do
  540. i:Destroy()
  541. end
  542. local buttontextcolor = Color3.new(1,1,1)
  543. local buttonbordercolor = Color3.new(0,0,0)
  544. local buttonbackgroundcolor = Color3.new(61/255, 61/255, 61/255)
  545.  
  546. questframe.Things.Informations.Finish.Visible = false
  547. questframe.Things.Informations.Finish.Text = "Finish quest!"
  548. if data:FindFirstChild("CustomizingScript") then
  549. local configuration = require(data["CustomizingScript"])
  550. if configuration["ButtonTextColor"] then buttontextcolor = configuration["ButtonTextColor"] end
  551. if configuration["ButtonBorderColor"] then buttonbordercolor = configuration["ButtonBorderColor"] end
  552. if configuration["ButtonBackgroundColor"] then buttonbackgroundcolor = configuration["ButtonBackgroundColor"] end
  553. if configuration["FinishTextColor"] then questframe.Things.Informations.Finish.TextColor3 = configuration["FinishTextColor"] end
  554. if configuration["FinishBorderColor"] then questframe.Things.Informations.Finish.BorderColor3 = configuration["FinishBorderColor"] end
  555. if configuration["FinishBackgroundColor"] then questframe.Things.Informations.Finish.BackgroundColor3 = configuration["FinishBackgroundColor"] end
  556. else
  557. questframe.Things.Informations.Finish.TextColor3 = buttontextcolor
  558. questframe.Things.Informations.Finish.BorderColor3 = buttonbordercolor
  559. questframe.Things.Informations.Finish.BackgroundColor3 = buttonbackgroundcolor
  560. end
  561. questframe.Things.Informations.Awards.Text = "Awards:"
  562. questframe.Things.Informations.QuestDescription.Text = "Quest Description:"
  563. questframe.Things.Informations.QuestName.Text = "Quest Name:"
  564. questframe.Things.Informations.RequiredItems.Text = "Required Items:"
  565. questframe.Image.Image = "rbxassetid://"..tostring(data.Image.Value)
  566. questframe.Quote.Text = data.Quote.Value
  567. questframe.SName.Text = data.SName.Value
  568. local C_Quest_ID = nil
  569. local function SetupInformations(controller)
  570. local finished = controller.GetFinishedState()
  571. local informations = controller.GetInformations()
  572. questframe.Things.Informations.Finish.Visible = not finished
  573. questframe.Things.Informations.Finish.Text = "Finish quest!"
  574. questframe.Things.Informations.Awards.Text = "Awards: "..informations.Awards
  575. questframe.Things.Informations.QuestDescription.Text = "Quest Description: "..informations.Desc
  576. questframe.Things.Informations.QuestName.Text = "Quest Name: "..informations.Name
  577. questframe.Things.Informations.RequiredItems.Text = "Required Items: "..informations.RequiredItems
  578. end
  579. questframe.Things.Informations.Finish.MouseButton1Click:connect(function()
  580. if not C_Quest_ID then return end
  581. if not data.Quests:FindFirstChild(C_Quest_ID) then return end
  582. local mod = require(data.Quests[C_Quest_ID])
  583. local suc, msg = mod(CallServer, mods).FinishClicked()
  584. local C_ID = C_Quest_ID
  585. questframe.Things.Informations.Finish.Text = msg
  586. if suc then
  587. questframe.Things.Quests.Quests[C_Quest_ID].Finished.Text = "FINISHED!"
  588. questframe.Things.Quests.Quests[C_Quest_ID].Finished.TextColor3 = Color3.new(0, 175/255, 0)
  589. end
  590. wait(5)
  591. if not (C_Quest_ID == C_ID) then return end
  592. if suc then questframe.Things.Informations.Finish.Visible = false end
  593. questframe.Things.Informations.Finish.Text = "Finish quest!"
  594. end)
  595.  
  596. local function GetDoneQuests()
  597. local num = 0
  598. for _, i in pairs(data.Quests:GetChildren()) do
  599. local QuestData = require(i)(CallServer, mods)
  600. if QuestData.GetFinishedState() and QuestData.CountedToMilestone then
  601. num = num + 1
  602. end
  603. end
  604. return num
  605. end
  606.  
  607. local y = 1 / #data.Quests:GetChildren()
  608. if #data.Quests:GetChildren() <= 5 then
  609. y = 0.2
  610. end
  611. for num, but in pairs(data.Quests:GetChildren()) do
  612. local B = Instance.new("Frame", questframe.Things.Quests.Quests)
  613. B.Name = but.Name
  614. B.Position = UDim2.new(0.15, 0, y * (num - 1) + (y / 4), 0)
  615. B.Size = UDim2.new(0.7, 0, y - (y / 4), 0)
  616. B.BackgroundColor3 = buttonbackgroundcolor
  617. B.BorderColor3 = buttonbordercolor
  618. B.BorderSizePixel = 1
  619. local HB = Instance.new("TextButton", B)
  620. HB.Name = "Hitbox"
  621. HB.Text = ""
  622. HB.BackgroundTransparency = 1
  623. HB.Position = UDim2.new(0,0,0,0)
  624. HB.Size = UDim2.new(1,0,1,0)
  625. HB.ZIndex = 5
  626. local N = Instance.new("TextLabel", B)
  627. N.Name = "Number"
  628. N.Position = UDim2.new(0,0,0,0)
  629. N.Size = UDim2.new(1, 0, 0.65, 0)
  630. N.Font = Enum.Font.ArialBold
  631. N.Text = "Quest #"..but.Name
  632. N.TextColor3 = buttontextcolor
  633. N.TextScaled = true
  634. N.TextXAlignment = Enum.TextXAlignment.Left
  635. N.TextYAlignment = Enum.TextYAlignment.Top
  636. N.BackgroundTransparency = 1
  637. local F = Instance.new("TextLabel", B)
  638. F.Name = "Finished"
  639. F.Position = UDim2.new(0,0,0.65,0)
  640. F.Size = UDim2.new(1, 0, 0.35, 0)
  641. F.Font = Enum.Font.ArialBold
  642. F.Text = "NOT FINISHED!"
  643. F.BackgroundTransparency = 1
  644. F.TextColor3 = Color3.new(175/255, 0, 0)
  645. F.TextScaled = true
  646. F.TextXAlignment = Enum.TextXAlignment.Left
  647. F.TextYAlignment = Enum.TextYAlignment.Top
  648. -- SETUPPING
  649. local controller = require(but)(CallServer, mods)
  650. if controller.GetFinishedState() then F.Text = "FINISHED!" F.TextColor3 = Color3.new(0, 175/255, 0) end
  651. HB.MouseButton1Click:connect(function()
  652. C_Quest_ID = but.Name
  653. SetupInformations(controller)
  654. end)
  655. if 0.2 * num + 0.05 < 1 then
  656. questframe.Things.Quests.Quests.CanvasSize = UDim2.new(0, 0, 0, 0)
  657. else
  658. questframe.Things.Quests.Quests.CanvasSize = UDim2.new(0, 0, (0.15 * num) + 0.05, 0)
  659. end
  660. end
  661. local y = 1 / #data.Milestones:GetChildren()
  662. if #data.Milestones:GetChildren() <= 5 then
  663. y = 0.2
  664. end
  665. for num, but in pairs(data.Milestones:GetChildren()) do
  666. local controller = require(but)(CallServer, mods)
  667. local B = Instance.new("Frame", questframe.Things.Milestones.Milestones)
  668. B.Name = but.Name
  669. B.Position = UDim2.new(0.15, 0, y * (num - 1) + (y / 4), 0)
  670. B.Size = UDim2.new(0.7, 0, y - (y / 4), 0)
  671. B.BackgroundColor3 = buttonbackgroundcolor
  672. B.BorderColor3 = buttonbordercolor
  673. B.BorderSizePixel = 1
  674. local HB = Instance.new("TextButton", B)
  675. HB.Name = "Hitbox"
  676. HB.Text = ""
  677. HB.BackgroundTransparency = 1
  678. HB.Position = UDim2.new(0,0,0,0)
  679. HB.Size = UDim2.new(1,0,1,0)
  680. HB.ZIndex = 5
  681. local N = Instance.new("TextLabel", B)
  682. N.Name = "Number"
  683. N.Position = UDim2.new(0,0,0,0)
  684. N.BackgroundTransparency = 1
  685. N.Size = UDim2.new(1, 0, 0.65, 0)
  686. N.Font = Enum.Font.ArialBold
  687. N.Text = "Milestone #"..but.Name.." ("..controller.GetInformations().QuestsNeeded.." Quests)"
  688. N.TextColor3 = buttontextcolor
  689. N.TextScaled = true
  690. N.TextXAlignment = Enum.TextXAlignment.Left
  691. N.TextYAlignment = Enum.TextYAlignment.Top
  692. local F = Instance.new("TextLabel", B)
  693. F.Name = "Finished"
  694. F.BackgroundTransparency = 1
  695. F.Position = UDim2.new(0,0,0.65,0)
  696. F.Size = UDim2.new(1, 0, 0.35, 0)
  697. F.Font = Enum.Font.ArialBold
  698. F.Text = controller.GetFinishedState() and "FINISHED!" or controller.GetInformations().Awards
  699. F.TextColor3 = controller.GetFinishedState() and Color3.new(0, 175/255, 0) or buttontextcolor
  700. F.TextScaled = true
  701. F.TextXAlignment = Enum.TextXAlignment.Left
  702. F.TextYAlignment = Enum.TextYAlignment.Top
  703. HB.MouseButton1Click:connect(function()
  704. if GetDoneQuests() >= controller.GetInformations().QuestsNeeded then
  705. if controller.FinishClicked() then
  706. F.Text = "FINISHED!"
  707. F.TextColor3 = Color3.new(0, 175/255, 0)
  708. end
  709. end
  710. end)
  711. -- SETUPPING
  712. if 0.2 * num + 0.05 < 1 then
  713. questframe.Things.Milestones.Milestones.CanvasSize = UDim2.new(0, 0, 0, 0)
  714. else
  715. questframe.Things.Milestones.Milestones.CanvasSize = UDim2.new(0, 0, (0.15 * num) + 0.05, 0)
  716. end
  717. end
  718. -- LOADING CUSTOMIZING SCRIPT
  719. Quests_LoadOrgSettings()
  720. if data:FindFirstChild("CustomizingScript") then
  721. local function SetSetting(part, setting, newvalue)
  722. local canapply = true
  723. if string.sub(setting, 1, 4) == "Text" then
  724. if string.sub(part.ClassName, 1, 4) ~= "Text" then
  725. canapply = false
  726. end
  727. end
  728. if canapply then
  729. part[setting] = newvalue
  730. end
  731. end
  732. local configuration = require(data["CustomizingScript"])
  733. if configuration["BorderColor"] then
  734. SetSetting(questframe, "BorderColor3", configuration["BorderColor"])
  735. for _, i in pairs(questframe:GetChildren()) do
  736. if i:IsA'Frame' then
  737. for _, o in pairs(i:GetChildren()) do
  738. SetSetting(o, "BorderColor3", configuration["BorderColor"])
  739. end
  740. end
  741. SetSetting(i, "BorderColor3", configuration["BorderColor"])
  742. end
  743. end
  744. if configuration["BorderSize"] then
  745. SetSetting(questframe, "BorderSizePixel", configuration["BorderSize"])
  746. for _, i in pairs(questframe:GetChildren()) do
  747. if i:IsA'Frame' then
  748. for _, o in pairs(i:GetChildren()) do
  749. SetSetting(o, "BorderSizePixel", configuration["BorderSize"])
  750. end
  751. end
  752. SetSetting(i, "BorderSizePixel", configuration["BorderSize"])
  753. end
  754. end
  755. if configuration["BackgroundColor"] then
  756. SetSetting(questframe, "BackgroundColor3", configuration["BackgroundColor"])
  757. for _, i in pairs(questframe:GetChildren()) do
  758. if i:IsA'Frame' then
  759. for _, o in pairs(i:GetChildren()) do
  760. SetSetting(o, "BackgroundColor3", configuration["BackgroundColor"])
  761. end
  762. end
  763. SetSetting(i, "BackgroundColor3", configuration["BackgroundColor"])
  764. end
  765. end
  766. if configuration["BackgroundTransparency"] then
  767. SetSetting(questframe, "BackgroundTransparency", configuration["BackgroundTransparency"])
  768. for _, i in pairs(questframe:GetChildren()) do
  769. if i:IsA'Frame' then
  770. for _, o in pairs(i:GetChildren()) do
  771. SetSetting(o, "BackgroundTransparency", configuration["BackgroundTransparency"])
  772. end
  773. end
  774. SetSetting(i, "BackgroundTransparency", configuration["BackgroundTransparency"])
  775. end
  776. end
  777. if configuration["TextColor"] then
  778. SetSetting(questframe, "TextColor3", configuration["TextColor"])
  779. for _, i in pairs(questframe:GetChildren()) do
  780. if i:IsA'Frame' then
  781. for _, o in pairs(i:GetChildren()) do
  782. SetSetting(o, "TextColor3", configuration["TextColor"])
  783. end
  784. end
  785. SetSetting(i, "TextColor3", configuration["TextColor"])
  786. end
  787. end
  788. if configuration["TextTransparency"] then
  789. SetSetting(questframe, "TextTransparency", configuration["TextTransparency"])
  790. for _, i in pairs(questframe:GetChildren()) do
  791. if i:IsA'Frame' then
  792. for _, o in pairs(i:GetChildren()) do
  793. SetSetting(o, "TextTransparency", configuration["TextTransparency"])
  794. end
  795. end
  796. SetSetting(i, "TextTransparency", configuration["TextTransparency"])
  797. end
  798. end
  799. if configuration["TextStrokeColor"] then
  800. SetSetting(questframe, "TextStrokeColor3", configuration["TextStrokeColor"])
  801. for _, i in pairs(questframe:GetChildren()) do
  802. if i:IsA'Frame' then
  803. for _, o in pairs(i:GetChildren()) do
  804. SetSetting(o, "TextStrokeColor3", configuration["TextStrokeColor"])
  805. end
  806. end
  807. SetSetting(i, "TextStrokeColor3", configuration["TextStrokeColor"])
  808. end
  809. end
  810. if configuration["TextStrokeTransparency"] then
  811. SetSetting(questframe, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
  812. for _, i in pairs(questframe:GetChildren()) do
  813. if i:IsA'Frame' then
  814. for _, o in pairs(i:GetChildren()) do
  815. SetSetting(o, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
  816. end
  817. end
  818. SetSetting(i, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
  819. end
  820. end
  821. end
  822. return true
  823. end
  824. return false
  825. end
  826.  
  827. local ef = gui.Expand
  828. local hb = gui.HideBar
  829. local ib = gui.InfoBar
  830. local debounce = {["Expand"] = false}
  831. local prepared = nil
  832. local efnormal = {ef.HitBox:Clone(), ef.Special:Clone()}
  833.  
  834. game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
  835. local ondeathframe = Instance.new("Frame", script.Parent)
  836. ondeathframe.Position = UDim2.new(0, 0, -1, 0)
  837. ondeathframe.Size = UDim2.new(1, 0, 2, 0)
  838. ondeathframe.BackgroundColor3 = Color3.new(65/255, 65/255, 65/255)
  839. ondeathframe.ZIndex = 9
  840. ondeathframe.BorderSizePixel = 0
  841. ondeathframe.BackgroundTransparency = 1
  842. local img = Instance.new("ImageLabel", ondeathframe)
  843. img.BackgroundTransparency = 1
  844. img.ImageTransparency = 1
  845. img.Position = UDim2.new(0, 0, 0.5, 0)
  846. img.Size = UDim2.new(1, 0, 0.5, 0)
  847. img.ZIndex = 10
  848. img.Image = ReturnConf("BackgroundImage")[GetDayState()]
  849. for i = 1, 0, -0.05 do
  850. ondeathframe.BackgroundTransparency = i
  851. img.ImageTransparency = i
  852. wait(1/60)
  853. end
  854. ondeathframe.BackgroundTransparency = 0
  855. img.ImageTransparency = 0
  856. end)
  857.  
  858. if game:GetService("UserInputService").GamepadEnabled then
  859. prepared = "XBOX"
  860. if ef:FindFirstChild("HitBox") then ef.HitBox:Destroy() end
  861. if ef:FindFirstChild("Special") then ef.Special:Destroy() end
  862. local ModuleAsset = game:GetService('InsertService'):LoadAsset(408470686)
  863. local InputImageLibrary = require(ModuleAsset.MainModule)
  864. local ImageControl = InputImageLibrary:GetImageLabel(Enum.KeyCode.ButtonY, "Dark")
  865. ImageControl.Parent = ef
  866. ImageControl.Size = UDim2.new(1, 0, 1, 0)
  867. ImageControl.ZIndex = 6
  868. ImageControl.BackgroundTransparency = 1
  869. ImageControl.Position = UDim2.new(0.12, 0, 0, 0)
  870. ImageControl.Size = UDim2.new(1.87, 0, 1, 0)
  871. ImageControl.Name = "XBoxControlImage"
  872. else
  873. prepared = "NORMAL"
  874. ef.HitBox.MouseButton1Click:connect(function()
  875. if debounce["Expand"] == false then
  876. debounce["Expand"] = true
  877. if mobileinterface then
  878. ef:TweenPosition(UDim2.new(0.54, 0, 0, 0), "Out", "Quad", 1, true)
  879. hb:TweenPosition(UDim2.new(0.3, 0, 0, 0), "Out", "Quad", 1, true)
  880. else
  881. ef:TweenPosition(UDim2.new(0.34, 0, 0, 0), "Out", "Quad", 1, true)
  882. hb:TweenPosition(UDim2.new(0.2, 0,0, 0), "Out", "Quad", 1, true)
  883. end
  884. for _, i in pairs(hb:GetChildren()) do
  885. i.Active = true
  886. end
  887. local Showing = false -- CONFIG
  888. local STick = tick()
  889. while true do
  890. local Seconds = tick() - STick
  891. if debounce["Expand"] == not Showing then
  892. if Showing then
  893. if Seconds > 0 then
  894. ef.Special.Special2.BackgroundTransparency = 1 - Seconds
  895. else
  896. ef.Special.Special2.BackgroundTransparency = 0
  897. break
  898. end
  899. else
  900. if Seconds < 1 then
  901. ef.Special.Special2.BackgroundTransparency = Seconds
  902. else
  903. ef.Special.Special2.BackgroundTransparency = 1
  904. break
  905. end
  906. end
  907. else
  908. break
  909. end
  910. wait(1/60)
  911. end
  912. elseif debounce["Expand"] == true then
  913. debounce["Expand"] = false
  914. if mobileinterface then
  915. ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true)
  916. hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true)
  917. else
  918. hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true)
  919. ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true)
  920. end
  921. for _, i in pairs(hb:GetChildren()) do
  922. i.Active = false
  923. end
  924. local Showing = true -- CONFIG
  925. local STick = tick()
  926. while true do
  927. local Seconds = tick() - STick
  928. if debounce["Expand"] == not Showing then
  929. if Showing then
  930. if Seconds > 0 then
  931. ef.Special.Special2.BackgroundTransparency = 1 - Seconds
  932. else
  933. ef.Special.Special2.BackgroundTransparency = 0
  934. break
  935. end
  936. else
  937. if Seconds < 1 then
  938. ef.Special.Special2.BackgroundTransparency = Seconds
  939. else
  940. ef.Special.Special2.BackgroundTransparency = 1
  941. break
  942. end
  943. end
  944. else
  945. break
  946. end
  947. wait(1/60)
  948. end
  949. end
  950. end)
  951. end
  952. game:GetService("UserInputService").InputBegan:connect(function(input)
  953. if input.UserInputType == Enum.UserInputType.Gamepad1 then
  954. if input.KeyCode == Enum.KeyCode.ButtonY then
  955. if not game:GetService("GuiService").MenuIsOpen then
  956. if debounce["Expand"] == false then
  957. debounce["Expand"] = true
  958. if mobileinterface then
  959. ef:TweenPosition(UDim2.new(0.54, 0, 0, 0), "Out", "Quad", 1, true)
  960. hb:TweenPosition(UDim2.new(0.3, 0, 0, 0), "Out", "Quad", 1, true)
  961. else
  962. ef:TweenPosition(UDim2.new(0.34, 0, 0, 0), "Out", "Quad", 1, true)
  963. hb:TweenPosition(UDim2.new(0.2, 0,0, 0), "Out", "Quad", 1, true)
  964. end
  965. for _, i in pairs(hb:GetChildren()) do
  966. i.Active = true
  967. end
  968. elseif debounce["Expand"] == true then
  969. debounce["Expand"] = false
  970. if mobileinterface then
  971. ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true)
  972. hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true)
  973. else
  974. hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true)
  975. ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true)
  976. end
  977. for _, i in pairs(hb:GetChildren()) do
  978. i.Active = false
  979. end
  980. end
  981. end
  982. end
  983. end
  984. end)
  985. game:GetService("UserInputService").GamepadConnected:connect(function(gamepad)
  986. if gamepad == Enum.UserInputType.Gamepad1 then
  987. if prepared == "NORMAL" then
  988. prepared = "XBOX"
  989. if ef:FindFirstChild("HitBox") then ef.HitBox:Destroy() end
  990. if ef:FindFirstChild("Special") then ef.Special:Destroy() end
  991. local ModuleAsset = game:GetService('InsertService'):LoadAsset(408470686)
  992. local InputImageLibrary = require(ModuleAsset.MainModule)
  993. local ImageControl = InputImageLibrary:GetImageLabel(Enum.KeyCode.ButtonY, "Dark")
  994. ImageControl.Parent = ef
  995. ImageControl.Size = UDim2.new(1, 0, 1, 0)
  996. ImageControl.ZIndex = 6
  997. ImageControl.BackgroundTransparency = 1
  998. ImageControl.Position = UDim2.new(0.12, 0, 0, 0)
  999. ImageControl.Size = UDim2.new(1.87, 0, 1, 0)
  1000. ImageControl.Name = "XBoxControlImage"
  1001. end
  1002. end
  1003. end)
  1004. game:GetService("UserInputService").GamepadDisconnected:connect(function(gamepad)
  1005. if gamepad == Enum.UserInputType.Gamepad1 then
  1006. if prepared == "XBOX" then
  1007. prepared = "NORMAL"
  1008. for _, i in pairs(efnormal) do
  1009. i:Clone().Parent = ef
  1010. end
  1011. ef.HitBox.MouseButton1Click:connect(function()
  1012. if debounce["Expand"] == false then
  1013. debounce["Expand"] = true
  1014. if mobileinterface then
  1015. ef:TweenPosition(UDim2.new(0.54, 0, 0, 0), "Out", "Quad", 1, true)
  1016. hb:TweenPosition(UDim2.new(0.3, 0, 0, 0), "Out", "Quad", 1, true)
  1017. else
  1018. ef:TweenPosition(UDim2.new(0.34, 0, 0, 0), "Out", "Quad", 1, true)
  1019. hb:TweenPosition(UDim2.new(0.2, 0,0, 0), "Out", "Quad", 1, true)
  1020. end
  1021. for _, i in pairs(hb:GetChildren()) do
  1022. i.Active = true
  1023. end
  1024.  
  1025. local Showing = false -- CONFIG
  1026. local STick = tick()
  1027. while true do
  1028. local Seconds = tick() - STick
  1029. if debounce["Expand"] == not Showing then
  1030. if Showing then
  1031. if Seconds > 0 then
  1032. ef.Special.Special2.BackgroundTransparency = 1 - Seconds
  1033. else
  1034. ef.Special.Special2.BackgroundTransparency = 0
  1035. break
  1036. end
  1037. else
  1038. if Seconds < 1 then
  1039. ef.Special.Special2.BackgroundTransparency = Seconds
  1040. else
  1041. ef.Special.Special2.BackgroundTransparency = 1
  1042. break
  1043. end
  1044. end
  1045. else
  1046. break
  1047. end
  1048. wait(1/60)
  1049. end
  1050. elseif debounce["Expand"] == true then
  1051. debounce["Expand"] = false
  1052. if mobileinterface then
  1053. ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true)
  1054. hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true)
  1055. else
  1056. hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true)
  1057. ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true)
  1058. end
  1059.  
  1060. for _, i in pairs(hb:GetChildren()) do
  1061. i.Active = false
  1062. end
  1063.  
  1064. local Showing = true -- CONFIG
  1065. local STick = tick()
  1066. while true do
  1067. local Seconds = tick() - STick
  1068. if debounce["Expand"] == not Showing then
  1069. if Showing then
  1070. if Seconds > 0 then
  1071. ef.Special.Special2.BackgroundTransparency = 1 - Seconds
  1072. else
  1073. ef.Special.Special2.BackgroundTransparency = 0
  1074. break
  1075. end
  1076. else
  1077. if Seconds < 1 then
  1078. ef.Special.Special2.BackgroundTransparency = Seconds
  1079. else
  1080. ef.Special.Special2.BackgroundTransparency = 1
  1081. break
  1082. end
  1083. end
  1084. else
  1085. break
  1086. end
  1087. wait(1/60)
  1088. end
  1089. end
  1090. end)
  1091. end
  1092. end
  1093. end)
  1094. local InTrade = false
  1095. -- INVENTORY
  1096. local UseTick = tick()
  1097. local currenttab = nil
  1098. local debounceinv = false
  1099. local function LoadInv(name)
  1100. if debounceinv == false then
  1101. debounceinv = true
  1102. currenttab = name
  1103. for _, i in pairs(script.Parent.Inventory:GetChildren()) do if i:IsA'TextButton' and i.Name ~= "Exit" then i.ZIndex = 2 i.BorderSizePixel = 3 end end
  1104. script.Parent.Inventory[name].BorderSizePixel = 0
  1105. script.Parent.Inventory[name].ZIndex = 1
  1106. for _, i in pairs(script.Parent.Inventory.Frame:GetChildren()) do i:Destroy() end
  1107. -- CALCULATING Y AND CANVASSIZE
  1108. local YY = math.floor(#script.Inventory[name]:GetChildren() / 5)
  1109. if #script.Inventory[name]:GetChildren() % 5 ~= 0 then
  1110. YY = YY + 1
  1111. end
  1112. local YC = 1 / YY
  1113. if YY < 4 then
  1114. YC = 0.25
  1115. end
  1116.  
  1117. for num, i in pairs(script.Inventory[name]:GetChildren()) do
  1118. num = num - 1
  1119. local position = num % 5
  1120. local line = ( num - position ) / 5
  1121. local Image = nil
  1122. if not InTrade then
  1123. if i:FindFirstChild("OnUse") then
  1124. Image = Instance.new("ImageButton", script.Parent.Inventory.Frame)
  1125. Image.MouseButton1Click:connect(function()
  1126. if UseTick + 1 < tick() then
  1127. UseTick = tick() + 99999
  1128. if CallServer("CheckForStat", i.Stat.Value) > 0 then
  1129. local candecrease = false
  1130. for _, o in pairs(mod(i.OnUse.Value)) do
  1131. if o[1] == "HBP" then
  1132. candecrease = true
  1133. CallServer("HealPlayer", tonumber(o[2]) / 100 * CallServer("GetMaxHP"))
  1134. elseif o[1] == "H" then
  1135. candecrease = true
  1136. CallServer("HealPlayer", tonumber(o[2]))
  1137. elseif o[1] == "G" then
  1138. candecrease = true
  1139. CallServer("IncreaseStat", o[2], tonumber(o[3]))
  1140. elseif o[1] == "GLVL" then
  1141. if CallServer("GetLVL") ~= 100 then
  1142. CallServer("IncreaseLVL", 1)
  1143. candecrease = true
  1144. end
  1145. elseif o[1] == "SUMMONBOSS" then
  1146. if CallServer("SummonBoss") then
  1147. candecrease = true
  1148. end
  1149. elseif o[1] == "EGGTRACKER" then
  1150. if openedframe ~= "TRADE" then script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true) end
  1151. if openedframe == "Inv" then
  1152. openedframe = ""
  1153. end
  1154. EggTracker_OnClick()
  1155. end
  1156. end
  1157. if candecrease then CallServer("DecreaseStat", i.Stat.Value, 1) end
  1158. LoadInv(name)
  1159. end
  1160. UseTick = tick()
  1161. end
  1162. end)
  1163. else
  1164. Image = Instance.new("ImageLabel", script.Parent.Inventory.Frame)
  1165. end
  1166. else
  1167. if i:FindFirstChild("Tradeable") then
  1168. Image = Instance.new("ImageButton", script.Parent.Inventory.Frame)
  1169. Image.MouseButton1Click:connect(function()
  1170. if CallServer("CheckForStat", i.Stat.Value) > 0 then
  1171. Trade_ChangeRequest("Add", i)
  1172. end
  1173. end)
  1174. else
  1175. Image = Instance.new("ImageLabel", script.Parent.Inventory.Frame)
  1176. end
  1177. end
  1178. Image.Image = "rbxassetid://"..i.Image.Value
  1179. Image.BackgroundTransparency = 1
  1180. Image.Position = UDim2.new((position * 0.2), 0, (line * YC), 0)
  1181. Image.Size = UDim2.new(0.15, 0, YC / 4 * 3, 0)
  1182. local text = Instance.new("TextLabel", script.Parent.Inventory.Frame)
  1183. text.BackgroundTransparency = 1
  1184. text.Position = UDim2.new((position * 0.2) + 0.10, 0, (line * YC) + (YC / 2), 0)
  1185. text.Size = UDim2.new(0.05, 0, YC / 4, 0)
  1186. text.Font = Enum.Font.ArialBold
  1187. text.TextScaled = true
  1188. text.TextColor3 = Color3.new(1,1,1)
  1189. local text2 = Instance.new("TextLabel", script.Parent.Inventory.Frame)
  1190. text2.BackgroundTransparency = 1
  1191. text2.Position = UDim2.new((position * 0.2), 0, (line * YC) + (YC / 4 * 3), 0)
  1192. text2.Size = UDim2.new(0.15, 0, (YC / 20 * 6), 0)
  1193. text2.Font = Enum.Font.ArialBold
  1194. text2.TextScaled = true
  1195. text2.Text = i.Name
  1196. text2.TextColor3 = Color3.new(1,1,1)
  1197. text.Text = "x"
  1198. text.Text = "x" .. Stats.GetStat(i.Stat.Value)
  1199. if (line + 1) * 0.25 < 1 then
  1200. script.Parent.Inventory.Frame.CanvasSize = UDim2.new(0, 0, 0, 0)
  1201. else
  1202. script.Parent.Inventory.Frame.CanvasSize = UDim2.new(0, 0, (line + 1) * 0.25, 0)
  1203. end
  1204. end
  1205. debounceinv = false
  1206. end
  1207. end
  1208. local X = 1 / #script.Inventory:GetChildren()
  1209. for num = 1, #script.Inventory:GetChildren(), 1 do
  1210. for _, i in pairs(script.Inventory:GetChildren()) do
  1211. if string.sub(i.Name, 1, 1) == tostring(num) then
  1212. local but = Instance.new("TextButton", script.Parent.Inventory)
  1213. but.Name = i.Name
  1214. but.Transparency = 0
  1215. but.BackgroundColor3 = Color3.new(65/255, 65/255, 65/255)
  1216. but.BorderSizePixel = 3
  1217. but.BorderColor3 = Color3.new(0, 0, 0)
  1218. but.Font = Enum.Font.SourceSansBold
  1219. but.Text = string.sub(i.Name, 2)
  1220. but.TextColor3 = Color3.new(1, 1, 1)
  1221. but.TextScaled = true
  1222. but.Size = UDim2.new(X, 0, 0.1, 0)
  1223. but.Position = UDim2.new((num - 1) * X, 0, 0, 0)
  1224. but.ZIndex = 2
  1225. -- FUNCTIONS
  1226. but.MouseButton1Click:connect(function() LoadInv(i.Name) end)
  1227. end
  1228. end
  1229. end
  1230. spawn(function() for _, i in pairs(script.Inventory:GetChildren()) do if string.sub(i.Name, 1, 1) == "1" then LoadInv(i.Name) end end end)
  1231. script.Parent.HideBar.Inventory.MouseButton1Click:connect(function()
  1232. if openedframe == "Inv" then
  1233. script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1234. openedframe = ""
  1235. elseif openedframe == "" then
  1236. if currenttab ~= nil then spawn(function() LoadInv(currenttab) end) end
  1237. script.Parent.Inventory:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1238. openedframe = "Inv"
  1239. end
  1240. end)
  1241. script.Parent.Inventory.Exit.MouseButton1Click:connect(function()
  1242. if openedframe ~= "TRADE" then script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true) end
  1243. if openedframe == "Inv" then
  1244. openedframe = ""
  1245. end
  1246. end)
  1247. -- TRADING
  1248.  
  1249. local Trade_Debounce = false
  1250. local func = nil
  1251.  
  1252. function Trade_Pending(cfunc)
  1253. func = cfunc
  1254. local responded = false
  1255. local function Respond(state)
  1256. if not responded then
  1257. responded = true
  1258. CallServer("Trade", "Respond", func.Id, state)
  1259. end
  1260. end
  1261. if not Trade_Debounce then
  1262. if CheckAcceptionSupport() then
  1263. local currentacceptationid = AddOnAcception(
  1264. function(state)
  1265. Respond(state)
  1266. return "Successfuly "..(state and "accepted" or "declined").." the request!"
  1267. end,
  1268. "You have received trade request from "..func.Sender
  1269. )
  1270. wait(16)
  1271. if accfuncid == currentacceptationid then
  1272. ResetOnAcceptation()
  1273. end
  1274. Respond(false)
  1275. else
  1276. local callback = Instance.new("BindableFunction")
  1277. callback.Parent = script
  1278. callback.Name = "TradeCallback"
  1279. callback.OnInvoke = function(answer)
  1280. local accepted = answer == "Accept"
  1281. if accepted then if Trade_Debounce then accepted = false end end
  1282. if accepted then Trade_Debounce = true end
  1283. Respond(accepted)
  1284. end
  1285. game.StarterGui:SetCore("SendNotification", {
  1286. Title = "Trade request",
  1287. Text = "You have received trade request from "..func.Sender,
  1288. Icon = "",
  1289. Duration = 10,
  1290. Callback = callback,
  1291. Button1 = "Accept",
  1292. Button2 = "Decline"
  1293. })
  1294. wait(11)
  1295. Respond(false)
  1296. end
  1297. else
  1298. Respond(false)
  1299. end
  1300. end
  1301.  
  1302. local tradeuser = nil
  1303. local tradesguy = nil
  1304. local currentoffer = nil
  1305.  
  1306. function Trade_Started(cfunc)
  1307. func = cfunc
  1308. Trade_Debounce = true
  1309. if func.Sender == game.Players.LocalPlayer.Name then
  1310. tradeuser = "Sender"
  1311. tradesguy = "Receiver"
  1312. elseif func.Receiver == game.Players.LocalPlayer.Name then
  1313. tradeuser = "Receiver"
  1314. tradesguy = "Sender"
  1315. end
  1316. script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1317. script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1318. script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1319.  
  1320. script.Parent.HideBar.Visible = false
  1321. script.Parent.InfoBar.Visible = false
  1322. script.Parent.Expand.Visible = false
  1323. game.Players.LocalPlayer.PlayerGui.SkillsGui.Holder:TweenPosition(UDim2.new(0.3, 0, 1.5, 0), "Out", "Quad", 1, true)
  1324. script.Parent.ChatFrame:TweenPosition(UDim2.new(0.005, 0, 0.701, 0), "Out", "Quad", 1, true)
  1325. script.Parent.Inventory:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true)
  1326. script.Parent.TradeFrame:TweenPosition(UDim2.new(0.5, 0, 0, 0), "Out", "Quad", 1, true)
  1327.  
  1328. InTrade = true
  1329.  
  1330. currentoffer = func[tradeuser.."Offer"]
  1331. script.Parent.TradeFrame.OTHEROFFER.Header.Text = func[tradesguy].."'s offer"
  1332.  
  1333. spawn(function() for _, i in pairs(script.Inventory:GetChildren()) do if string.sub(i.Name, 1, 1) == "1" then LoadInv(i.Name) end end end)
  1334.  
  1335. openedframe = "TRADE"
  1336. function Trade_Change(t, newval)
  1337. if tradeuser ~= nil then
  1338. if t == "BattlePoints" then if newval > 50 then newval = 50 end end
  1339. if t == "Cash" then if newval > 3000 then newval = 3000 end end
  1340. if t == "Bux" then if newval > 300 then newval = 300 end end
  1341. currentoffer[t] = newval
  1342. CallServer("Trade", "UpdateOffer", func.Id, tradeuser, currentoffer)
  1343. end
  1344. end
  1345. end
  1346. local accepted = false
  1347. local acceptation = 1
  1348. script.Parent.TradeFrame.Accept.MouseButton1Click:connect(function()
  1349. if not tradeuser then return end
  1350. if acceptation == 1 then
  1351. accepted = not accepted
  1352. CallServer("Trade", "Accept", func.Id, tradeuser, accepted)
  1353. elseif acceptation == 2 then
  1354. accepted = not accepted
  1355. CallServer("Trade", "Accept2", func.Id, tradeuser, accepted)
  1356. end
  1357. end)
  1358. script.Parent.TradeFrame.Cancel.MouseButton1Click:connect(function()
  1359. if InTrade then
  1360. CallServer("Trade", "Cancel", func.Id)
  1361. end
  1362. end)
  1363. local tradechangedebounce = true
  1364. function Trade_ChangeRequest(at, thing, newval)
  1365. if tradechangedebounce then
  1366. tradechangedebounce = false
  1367. if at == "Remove" then
  1368. currentoffer["Items"][thing] = nil
  1369. for i = thing, 4, 1 do
  1370. currentoffer["Items"][i] = currentoffer["Items"][i + 1]
  1371. end
  1372. currentoffer["Items"][5] = nil
  1373. elseif at == "Add" then
  1374. local id = nil
  1375. for index, i in pairs(currentoffer["Items"]) do
  1376. if i.Stat == thing.Stat.Value then
  1377. id = index
  1378. end
  1379. end
  1380. if id == nil then
  1381. if CallServer("GetStat", thing.Stat.Value) >= 1 then
  1382. currentoffer["Items"][#currentoffer["Items"] + 1] = {Stat = thing.Stat.Value, Data = thing, Name = thing.Name, Amount = 1}
  1383. end
  1384. else
  1385. if CallServer("GetStat", thing.Stat.Value) >= currentoffer["Items"][id].Amount + 1 then
  1386. currentoffer["Items"][id].Amount = currentoffer["Items"][id].Amount + 1
  1387. end
  1388. end
  1389. elseif at == "ChangeAmount" then
  1390. if newval >= 0 then
  1391. if CallServer("GetStat", currentoffer["Items"][thing]["Stat"]) >= newval then
  1392. currentoffer["Items"][thing]["Amount"] = newval
  1393. else
  1394. currentoffer["Items"][thing]["Amount"] = CallServer("GetStat", currentoffer["Items"][thing]["Stat"])
  1395. end
  1396. else
  1397. currentoffer["Items"][thing]["Amount"] = 0
  1398. end
  1399. end
  1400. Trade_Change("Items", currentoffer["Items"])
  1401. tradechangedebounce = true
  1402. end
  1403. end
  1404.  
  1405. for _, i in pairs(script.Parent.TradeFrame.YOUROFFER:GetChildren()) do
  1406. if i:IsA'Frame' then
  1407. i.HitBox.MouseButton1Click:connect(function()
  1408. if currentoffer["Items"][tonumber(i.Name)] then
  1409. Trade_ChangeRequest("Remove", tonumber(i.Name))
  1410. end
  1411. end)
  1412. end
  1413. end
  1414.  
  1415.  
  1416.  
  1417. script.Parent.TradeFrame.YOUROFFER.Coins.FocusLost:connect(function()
  1418. if tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text) ~= nil then
  1419. if tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text) <= CallServer("GetStat", "Cash") then
  1420. if tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text) >= 0 then
  1421. Trade_Change("Cash", tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text))
  1422. else
  1423. script.Parent.TradeFrame.YOUROFFER.Coins.Text = "0"
  1424. end
  1425. else
  1426. script.Parent.TradeFrame.YOUROFFER.Coins.Text = tostring(CallServer("GetStat", "Cash"))
  1427. Trade_Change("Cash", tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text))
  1428. end
  1429. end
  1430. end)
  1431. script.Parent.TradeFrame.YOUROFFER.Bux.FocusLost:connect(function()
  1432. if tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text) ~= nil then
  1433. if tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text) <= CallServer("GetStat", "PokeBux") then
  1434. if tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text) >= 0 then
  1435. Trade_Change("Bux", tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text))
  1436. else
  1437. script.Parent.TradeFrame.YOUROFFER.Bux.Text = "0"
  1438. end
  1439. else
  1440. script.Parent.TradeFrame.YOUROFFER.Bux.Text = tostring(CallServer("GetStat", "PokeBux"))
  1441. Trade_Change("Bux", tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text))
  1442. end
  1443. end
  1444. end)
  1445. script.Parent.TradeFrame.YOUROFFER.BattlePoints.FocusLost:connect(function()
  1446. if tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text) ~= nil then
  1447. if tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text) <= CallServer("GetStat", "BP") then
  1448. if tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text) >= 0 then
  1449. Trade_Change("BattlePoints", tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text))
  1450. else
  1451. script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = "0"
  1452. end
  1453. else
  1454. script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = tostring(CallServer("GetStat", "BP"))
  1455. Trade_Change("BattlePoints", tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text))
  1456. end
  1457. end
  1458. end)
  1459.  
  1460. -- UPDATE GUIS
  1461. local ImageHolder = {}
  1462. for _, i in pairs(script.Inventory:GetChildren()) do
  1463. for _, a in pairs(i:GetChildren()) do
  1464. if a:FindFirstChild("Image") then
  1465. ImageHolder[a.Name] = a.Image.Value
  1466. end
  1467. end
  1468. end
  1469.  
  1470. function Trade_Changed(cfunc)
  1471. func = cfunc
  1472. Trade_CleanGui(false)
  1473. if tradeuser == nil then return end
  1474. -- LocalPlayer
  1475. if cfunc["Acceptation2Frame"] == true then
  1476. acceptation = 2
  1477. accepted = cfunc[tradeuser.."Accepted2"]
  1478. script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0, 0), "Out", "Quad", 1, true)
  1479. script.Parent.TradeFrame:TweenPosition(UDim2.new(0.25, 0, 0, 0), "Out", "Quad", 1, true)
  1480. else
  1481. acceptation = 1
  1482. accepted = cfunc[tradeuser.."Accepted"]
  1483. script.Parent.Inventory:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true)
  1484. script.Parent.TradeFrame:TweenPosition(UDim2.new(0.5, 0, 0, 0), "Out", "Quad", 1, true)
  1485. end
  1486. script.Parent.TradeFrame.YOUROFFER.Bux.Text = tostring(cfunc[tradeuser.."Offer"].Bux)
  1487. script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = tostring(cfunc[tradeuser.."Offer"].BattlePoints)
  1488. script.Parent.TradeFrame.YOUROFFER.Coins.Text = tostring(cfunc[tradeuser.."Offer"].Cash)
  1489. if acceptation == 1 then
  1490. script.Parent.TradeFrame.YOUROFFER.READY.Text = cfunc[tradeuser.."Accepted"] and "READY" or "NOT READY"
  1491. script.Parent.TradeFrame.YOUROFFER.READY.TextColor3 = cfunc[tradeuser.."Accepted"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
  1492. elseif acceptation == 2 then
  1493. script.Parent.TradeFrame.YOUROFFER.READY.Text = cfunc[tradeuser.."Accepted2"] and "ACCEPTED" or "NOT ACCEPTED"
  1494. script.Parent.TradeFrame.YOUROFFER.READY.TextColor3 = cfunc[tradeuser.."Accepted2"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
  1495. end
  1496. for num, i in pairs(cfunc[tradeuser.."Offer"].Items) do
  1497. if script.Parent.TradeFrame.YOUROFFER:FindFirstChild(tostring(num)) then
  1498. local img = Instance.new("ImageLabel", script.Parent.TradeFrame.YOUROFFER[tostring(num)])
  1499. img.BackgroundTransparency = 1
  1500. img.Position = UDim2.new(0,0,0,0)
  1501. img.Size = UDim2.new(1,0,1,0)
  1502. img.Image = "rbxassetid://"..tostring(ImageHolder[i.Name])
  1503. img.ZIndex = 8
  1504. local textbox = Instance.new("TextBox", script.Parent.TradeFrame.YOUROFFER[tostring(num)])
  1505. textbox.BackgroundTransparency = 1
  1506. textbox.Position = UDim2.new(0.5, 0, 0.7, 0)
  1507. textbox.Size = UDim2.new(0.5, 0, 0.3, 0)
  1508. textbox.TextXAlignment = "Right"
  1509. textbox.TextScaled = true
  1510. textbox.TextColor3 = Color3.new(1,1,1)
  1511. textbox.Font = "ArialBold"
  1512. textbox.Text = tostring(i.Amount)
  1513. textbox.ZIndex = 10
  1514. textbox.FocusLost:connect(function()
  1515. if tonumber(textbox.Text) ~= nil then
  1516. if tonumber(textbox.Text) >= 1 then
  1517. if tonumber(textbox.Text) > CallServer("GetStat", i["Stat"]) then
  1518. textbox.Text = tostring(CallServer("GetStat", i["Stat"]))
  1519. end
  1520. Trade_ChangeRequest("ChangeAmount", num, tonumber(textbox.Text))
  1521. else
  1522. textbox.Text = "1"
  1523. end
  1524. end
  1525. end)
  1526. end
  1527. end
  1528. -- OtherPlayer
  1529. script.Parent.TradeFrame.OTHEROFFER.Bux.Text = tostring(cfunc[tradesguy.."Offer"].Bux)
  1530. script.Parent.TradeFrame.OTHEROFFER.BattlePoints.Text = tostring(cfunc[tradesguy.."Offer"].BattlePoints)
  1531. script.Parent.TradeFrame.OTHEROFFER.Coins.Text = tostring(cfunc[tradesguy.."Offer"].Cash)
  1532. if acceptation == 1 then
  1533. script.Parent.TradeFrame.Accept.Text = "Trade!"
  1534. script.Parent.TradeFrame.Cancel.Text = "Cancel"
  1535. script.Parent.TradeFrame.OTHEROFFER.READY.Text = cfunc[tradesguy.."Accepted"] and "READY" or "NOT READY"
  1536. script.Parent.TradeFrame.OTHEROFFER.READY.TextColor3 = cfunc[tradesguy.."Accepted"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
  1537. elseif acceptation == 2 then
  1538. script.Parent.TradeFrame.Accept.Text = "Accept!"
  1539. script.Parent.TradeFrame.Cancel.Text = "Decline"
  1540. script.Parent.TradeFrame.OTHEROFFER.READY.Text = cfunc[tradesguy.."Accepted2"] and "ACCEPTED" or "NOT ACCEPTED"
  1541. script.Parent.TradeFrame.OTHEROFFER.READY.TextColor3 = cfunc[tradesguy.."Accepted2"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
  1542. end
  1543. for num, i in pairs(cfunc[tradesguy.."Offer"].Items) do
  1544. if script.Parent.TradeFrame.OTHEROFFER:FindFirstChild(tostring(num)) then
  1545. local img = Instance.new("ImageLabel", script.Parent.TradeFrame.OTHEROFFER[tostring(num)])
  1546. img.BackgroundTransparency = 1
  1547. img.Position = UDim2.new(0,0,0,0)
  1548. img.Size = UDim2.new(1,0,1,0)
  1549. img.Image = "rbxassetid://"..tostring(ImageHolder[i.Name])
  1550. img.ZIndex = 8
  1551. local textbox = Instance.new("TextLabel", script.Parent.TradeFrame.OTHEROFFER[tostring(num)])
  1552. textbox.BackgroundTransparency = 1
  1553. textbox.Position = UDim2.new(0.5, 0, 0.7, 0)
  1554. textbox.Size = UDim2.new(0.5, 0, 0.3, 0)
  1555. textbox.TextXAlignment = "Right"
  1556. textbox.TextScaled = true
  1557. textbox.TextColor3 = Color3.new(1,1,1)
  1558. textbox.Font = "ArialBold"
  1559. textbox.Text = tostring(i.Amount)
  1560. textbox.ZIndex = 10
  1561. end
  1562. end
  1563. end
  1564.  
  1565. function Trade_CleanGui(clrall)
  1566. for _, i in pairs(script.Parent.TradeFrame.YOUROFFER:GetChildren()) do
  1567. if i:IsA'Frame' then
  1568. for _, a in pairs(i:GetChildren()) do
  1569. if a.Name ~= "HitBox" then
  1570. a:Destroy()
  1571. end
  1572. end
  1573. end
  1574. end
  1575. for _, i in pairs(script.Parent.TradeFrame.OTHEROFFER:GetChildren()) do
  1576. if i:IsA'Frame' then
  1577. for _, a in pairs(i:GetChildren()) do
  1578. if a.Name ~= "HitBox" then
  1579. a:Destroy()
  1580. end
  1581. end
  1582. end
  1583. end
  1584. if clrall then
  1585. acceptation = 1
  1586. accepted = false
  1587. script.Parent.TradeFrame.Accept.Text = "Trade!"
  1588. script.Parent.TradeFrame.Cancel.Text = "Cancel"
  1589. script.Parent.TradeFrame.YOUROFFER.Coins.Text = "0"
  1590. script.Parent.TradeFrame.YOUROFFER.Bux.Text = "0"
  1591. script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = "0"
  1592. script.Parent.TradeFrame.YOUROFFER.READY.Text = "NOT READY"
  1593. script.Parent.TradeFrame.YOUROFFER.READY.TextColor3 = Color3.new(175/255, 0, 0)
  1594. script.Parent.TradeFrame.OTHEROFFER.Coins.Text = "0"
  1595. script.Parent.TradeFrame.OTHEROFFER.Bux.Text = "0"
  1596. script.Parent.TradeFrame.OTHEROFFER.BattlePoints.Text = "0"
  1597. script.Parent.TradeFrame.OTHEROFFER.READY.Text = "NOT READY"
  1598. script.Parent.TradeFrame.OTHEROFFER.READY.TextColor3 = Color3.new(175/255, 0, 0)
  1599. script.Parent.TradeFrame.OTHEROFFER.Header.Text = "PLAYER's offer"
  1600. end
  1601. end
  1602.  
  1603. function Trade_Ended(cfunc)
  1604. func = cfunc
  1605. game.StarterGui:SetCore("SendNotification", {
  1606. Title = "Trade has ended",
  1607. Text = func.EndMessage,
  1608. Icon = "",
  1609. Duration = 10,
  1610. })
  1611. InTrade = false
  1612. currentoffer = nil
  1613.  
  1614. spawn(function() for _, i in pairs(script.Inventory:GetChildren()) do if string.sub(i.Name, 1, 1) == "1" then LoadInv(i.Name) end end end)
  1615.  
  1616. tradeuser = nil
  1617. tradesguy = nil
  1618.  
  1619. script.Parent.HideBar.Visible = true
  1620. script.Parent.InfoBar.Visible = true
  1621. script.Parent.Expand.Visible = true
  1622. game.Players.LocalPlayer.PlayerGui.SkillsGui.Holder:TweenPosition(UDim2.new(0.3, 0, 0.85, 0), "Out", "Quad", 1, true)
  1623. script.Parent.ChatFrame:TweenPosition(UDim2.new(0.0005, 0, 0.201, 0), "Out", "Quad", 1, true)
  1624. script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1625. script.Parent.TradeFrame:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1626. Trade_CleanGui(true)
  1627. Trade_Debounce = false
  1628. openedframe = ""
  1629. end
  1630.  
  1631. -- EVOLVES
  1632. local curdir = script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]
  1633. local curevolvelvl = 0 -- After evolving it raises and raises
  1634. local alreadyevolved = false
  1635.  
  1636. local function FindPreviousPokemon(dir)
  1637. local parent
  1638. if dir.Parent.Name ~= "Evolves" then
  1639. parent = dir
  1640. else
  1641. parent = dir.Parent
  1642. end
  1643. if parent ~= nil then
  1644. if parent.Parent.Parent.Name ~= "Pokemons" then
  1645. return parent.Parent
  1646. else
  1647. return parent
  1648. end
  1649. end
  1650. end
  1651.  
  1652. local function ExecuteEvolveLoading()
  1653. local currentevolvelevel = curevolvelvl
  1654. local curevolve = ""
  1655. function LoadEv(name)
  1656. curevolve = name
  1657. script.Parent.Evolves.pname.Text = name
  1658. script.Parent.Evolves.needs.Text = "Needs:\n"
  1659. for _, i in pairs(script.Parent.Evolves:GetChildren()) do if i:IsA'TextButton' and i.Name ~= "Exit" and i.Name ~= "evolve" then
  1660. i.BorderSizePixel = 3
  1661. i.ZIndex = 3
  1662. if i.Name == name then
  1663. i.BorderSizePixel = 0
  1664. i.ZIndex = 2
  1665. end
  1666. end end
  1667. local decoded = nil
  1668. if curdir:FindFirstChild("Evolves") then
  1669. if curdir.Evolves:FindFirstChild(curevolve) then
  1670. if curdir.Evolves[curevolve]:FindFirstChild("Need") then
  1671. decoded = mod(curdir.Evolves[curevolve].Need.Value)
  1672. end
  1673. end
  1674. else
  1675. if curdir:FindFirstChild(curevolve) then
  1676. if curdir[curevolve]:FindFirstChild("Need") then
  1677. decoded = mod(curdir[curevolve].Need.Value)
  1678. end
  1679. end
  1680. end
  1681. if decoded ~= nil then
  1682. for _, i in pairs(decoded) do
  1683. if i[1] == "LVL" then
  1684. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. i[2] .. " Level"
  1685. elseif i[1] == "C" then
  1686. for id, v in pairs(mod2(i[2])) do
  1687. if id ~= 1 then
  1688. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " or "
  1689. end
  1690. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. v .. " x" .. i[3]
  1691. end
  1692. elseif i[1] == "T" then
  1693. for id, v in pairs(mod2(i[2])) do
  1694. if id ~= 1 then
  1695. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " or "
  1696. end
  1697. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. v .. " x" .. i[3]
  1698. end
  1699. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " (will be taken)"
  1700. elseif i[1] == "DAY" then
  1701. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "Day needed"
  1702. elseif i[1] == "NIGHT" then
  1703. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "Night needed"
  1704. end
  1705. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "\n"
  1706. end
  1707. else
  1708. script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "No needs"
  1709. end
  1710. end
  1711. local debounce = true
  1712. script.Parent.Evolves.evolve.MouseButton1Click:connect(function()
  1713. if debounce == true then
  1714. debounce = false
  1715. -- EVOLVING FUNCTION
  1716. if currentevolvelevel == curevolvelvl and curevolve ~= nil and curevolve ~= "" then
  1717. local canevolve = true
  1718. local decoded = nil
  1719. local mega = false
  1720. local randback = false
  1721. if curevolve ~= "Random" and curevolve ~= "Back" then
  1722. if curdir:FindFirstChild("Evolves") then
  1723. if curdir.Evolves:FindFirstChild(curevolve) then
  1724. if curdir.Evolves[curevolve]:FindFirstChild("MegaEvolution") then
  1725. mega = true
  1726. end
  1727. if curdir.Evolves[curevolve]:FindFirstChild("Need") then
  1728. decoded = mod(curdir.Evolves[curevolve].Need.Value)
  1729. end
  1730. end
  1731. else
  1732. if curdir:FindFirstChild(curevolve) then
  1733. if curdir[curevolve]:FindFirstChild("MegaEvolution") then
  1734. mega = true
  1735. end
  1736. if curdir[curevolve]:FindFirstChild("Need") then
  1737. decoded = mod(curdir[curevolve].Need.Value)
  1738. end
  1739. end
  1740. end
  1741. if decoded ~= nil then
  1742. for _, i in pairs(decoded) do
  1743. if i[1] == "LVL" then
  1744. if CallServer("GetLVL") < tonumber(i[2]) then
  1745. canevolve = false
  1746. end
  1747. elseif i[1] == "C" then
  1748. local passed = false
  1749. for id, v in pairs(mod2(i[2])) do
  1750. if Stats.GetStat(v) >= tonumber(i[3]) then
  1751. passed = true
  1752. end
  1753. end
  1754. if not passed then canevolve = false end
  1755. elseif i[1] == "T" then
  1756. local passed = false
  1757. for id, v in pairs(mod2(i[2])) do
  1758. if Stats.GetStat(v) >= tonumber(i[3]) then
  1759. passed = true
  1760. end
  1761. end
  1762. if not passed then canevolve = false end
  1763. elseif i[1] == "DAY" then
  1764. if CallServer("DayNight") ~= "D" then
  1765. canevolve = false
  1766. end
  1767. elseif i[1] == "NIGHT" then
  1768. if CallServer("DayNight") ~= "N" then
  1769. canevolve = false
  1770. end
  1771. end
  1772. end
  1773. end
  1774. elseif curevolve == "Back" then
  1775. if curdir:FindFirstChild("Evolves") then
  1776. if curdir.Evolves:FindFirstChild("Random") then
  1777. randback = true
  1778. end
  1779. else
  1780. if curdir:FindFirstChild("Random") then
  1781. randback = true
  1782. end
  1783. end
  1784. end
  1785. -- EVOLVE REQUIREMENTS CHECK
  1786. if canevolve then
  1787. local evolved = nil
  1788. if not mega then
  1789. if curevolve == "Back" then
  1790. if randback then
  1791. evolved = CallServer("Evolve", curdir.Name)
  1792. else
  1793. evolved = CallServer("Evolve", FindPreviousPokemon(curdir).Name)
  1794. end
  1795. else
  1796. evolved = CallServer("Evolve", curevolve)
  1797. end
  1798. else
  1799. evolved = CallServer("MegaEvolve", curevolve)
  1800. end
  1801. if evolved then
  1802. -- TAKING ITEMS
  1803. if curevolve ~= "Random" and curevolve ~= "Back" then
  1804. if decoded ~= nil then
  1805. for _, i in pairs(decoded) do
  1806. if i[1] == "T" then
  1807. for id, v in pairs(mod2(i[2])) do
  1808. if Stats.GetStat(v) >= tonumber(i[3]) then
  1809. CallServer("ChangeStat", v, Stats.GetStat(v) - tonumber(i[3]))
  1810. break
  1811. end
  1812. end
  1813. end
  1814. end
  1815. end
  1816. end
  1817. if curevolve ~= "Random" and curevolve ~= "Back" then
  1818. script.Parent.InfoBar:FindFirstChild("Name").Text = curevolve
  1819. elseif curevolve == "Back" and not randback then
  1820. script.Parent.InfoBar:FindFirstChild("Name").Text = FindPreviousPokemon(curdir).Name
  1821. end
  1822. script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1823. script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1824. openedframe = ""
  1825. curevolvelvl = curevolvelvl + 1
  1826. if curevolve ~= "Random" and curevolve ~= "Back" and not mega then
  1827. if curdir:FindFirstChild("Evolves") then
  1828. curdir = curdir.Evolves:FindFirstChild(curevolve)
  1829. elseif curdir:FindFirstChild(curevolve) then
  1830. curdir = curdir:FindFirstChild(curevolve)
  1831. end
  1832. elseif curevolve == "Back" and not randback then
  1833. curdir = FindPreviousPokemon(curdir)
  1834. end
  1835. script.Parent.Evolves.needs.Text = "Needs:"
  1836. script.Parent.Evolves.pname.Text = "Choose an evolution!"
  1837. if curevolve == "Random" then
  1838. alreadyevolved = true
  1839. elseif curevolve == "Back" and randback then
  1840. alreadyevolved = false
  1841. end
  1842. local tl = nil
  1843. if mega then
  1844. tl = Instance.new("TextLabel", script.Parent)
  1845. tl.Position = UDim2.new(0.7, 0, 1, 0)
  1846. tl.Size = UDim2.new(0.3, 0, 0.05, 0)
  1847. tl.BackgroundTransparency = 1
  1848. tl.TextColor3 = Color3.new(1,1,1)
  1849. tl.TextScaled = true
  1850. tl.Text = "De-evolving in 180 seconds!"
  1851. tl:TweenPosition(UDim2.new(0.7, 0, 0.95, 0), "Out", "Quad", 1, true)
  1852. end
  1853. local towait = mega == true and 180 or 10
  1854. while towait ~= 0 do
  1855. if tl then tl.Text = "De-evolving in "..tostring(towait).." seconds!" end
  1856. script.Parent.InfoBar.Evolve.Text = "Wait "..tostring(mega and towait + 120 or towait).." seconds"
  1857. towait = towait - 1
  1858. wait(1)
  1859. end
  1860. if tl then tl:TweenPosition(UDim2.new(0.7, 0, 1, 0), "Out", "Quad", 1, true, function() tl:Destroy() end) end
  1861.  
  1862. if mega then
  1863. CallServer("Evolve", curdir.Name, 1)
  1864. script.Parent.InfoBar:FindFirstChild("Name").Text = curdir.Name
  1865. towait = 120
  1866. while towait ~= 0 do
  1867. script.Parent.InfoBar.Evolve.Text = "Wait "..tostring(towait).." seconds"
  1868. towait = towait - 1
  1869. wait(1)
  1870. end
  1871. end
  1872. script.Parent.InfoBar.Evolve.Text = "Evolve"
  1873. ExecuteEvolveLoading()
  1874. end
  1875. end
  1876. end
  1877. debounce = true
  1878. end
  1879. end)
  1880. -- GETTING LIST OF EVOS
  1881. local tab = {} -- EVOS
  1882. if curdir:FindFirstChild("Evolves") then
  1883. for _, i in pairs(curdir.Evolves:GetChildren()) do
  1884. if i.Name == "Random" then
  1885. table.insert(tab, {Name = "Random"})
  1886. if alreadyevolved then
  1887. table.insert(tab, {Name = "Back"})
  1888. end
  1889. else
  1890. table.insert(tab, i)
  1891. end
  1892. end
  1893. else
  1894. for _, i in pairs(curdir:GetChildren()) do
  1895. if i:IsA'Folder' and i.Name ~= "SetStatsOnSpawn" and i.Name ~= "Weapons" and i.Name ~= "Spawns" then
  1896. if i.Name == "Random" then
  1897. table.insert(tab, {Name = "Random"})
  1898. if alreadyevolved then
  1899. table.insert(tab, {Name = "Back"})
  1900. end
  1901. else
  1902. table.insert(tab, i)
  1903. end
  1904. end
  1905. end
  1906. end
  1907.  
  1908. for _, i in pairs(script.Parent.Evolves:GetChildren()) do if i:IsA'TextButton' and i.Name ~= "evolve" and i.Name ~= "Exit" then i:Destroy() end end
  1909. local X = 0
  1910. if #tab ~= 0 then X = 1 / #tab end
  1911. for num, i in pairs(tab) do
  1912. local but = Instance.new("TextButton", script.Parent.Evolves)
  1913. but.Name = i.Name
  1914. but.Transparency = 0
  1915. but.BackgroundColor3 = Color3.new(65/255, 65/255, 65/255)
  1916. but.BorderSizePixel = 3
  1917. but.BorderColor3 = Color3.new(0, 0, 0)
  1918. but.Font = Enum.Font.SourceSansBold
  1919. but.Text = i.Name
  1920. but.TextColor3 = Color3.new(1, 1, 1)
  1921. but.TextScaled = true
  1922. but.Size = UDim2.new(X, 0, 0.1, 0)
  1923. but.Position = UDim2.new((num - 1) * X, 0, 0, 0)
  1924. but.ZIndex = 2
  1925. -- FUNCTIONS
  1926. but.MouseButton1Click:connect(function() LoadEv(i.Name) end)
  1927. end
  1928. if tab[1] ~= nil then
  1929. LoadEv(tab[1].Name)
  1930. end
  1931. end
  1932. ExecuteEvolveLoading()
  1933. script.Parent.InfoBar.Evolve.MouseButton1Click:connect(function()
  1934. if openedframe == "Ev" then
  1935. script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1936. openedframe = ""
  1937. elseif openedframe == "" then
  1938. if script.Parent.InfoBar.Evolve.Text == "Evolve" then
  1939. script.Parent.Evolves:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1940. openedframe = "Ev"
  1941. end
  1942. end
  1943. end)
  1944. script.Parent.Evolves.Exit.MouseButton1Click:connect(function()
  1945. script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  1946. if openedframe == "Ev" then
  1947. openedframe = ""
  1948. end
  1949. end)
  1950. -- PVP
  1951. local pvp = CallServer("GetStat", "PvP")
  1952. if pvp == 0 then
  1953. script.Parent.HideBar.PvP.Text = "Enable PvP"
  1954. elseif pvp == 1 then
  1955. script.Parent.HideBar.PvP.Text = "Disable PvP"
  1956. end
  1957. local PVPFDebounce = true
  1958. local Time = 0
  1959. function PVPDebounce()
  1960. if PVPFDebounce then
  1961. PVPFDebounce = false
  1962. local curpvp = pvp
  1963. pvp = 0.5
  1964. while Time ~= 0 do
  1965. script.Parent.HideBar.PvP.Text = "Wait "..tostring(Time).." seconds!"
  1966. Time = Time - 1
  1967. wait(1)
  1968. end
  1969. pvp = curpvp
  1970. if pvp == 1 then
  1971. script.Parent.HideBar.PvP.Text = "Disable PvP"
  1972. elseif pvp == 0 then
  1973. script.Parent.HideBar.PvP.Text = "Enable PvP"
  1974. end
  1975. PVPFDebounce = true
  1976. end
  1977. end
  1978. script.Parent.HideBar.PvP.MouseButton1Click:connect(function()
  1979. if pvp == 0 then
  1980. pvp = 1
  1981. CallServer("ChangeStat", "PvP", pvp)
  1982. script.Parent.HideBar.PvP.Text = "Disable PvP"
  1983. elseif pvp == 1 then
  1984. pvp = 0
  1985. CallServer("ChangeStat", "PvP", pvp)
  1986. script.Parent.HideBar.PvP.Text = "Enable PvP"
  1987. end
  1988. end)
  1989. script.WeaponUsed.Changed:connect(function()
  1990. if script.WeaponUsed.Value ~= false then
  1991. script.WeaponUsed.Value = false
  1992. Time = 60
  1993. PVPDebounce()
  1994. end
  1995. end)
  1996. -- MUSIC
  1997. local mute = CallServer("GetStat", "Mute")
  1998. if mute == 0 then
  1999. script.Parent.HideBar.Music.Text = "Mute music"
  2000. elseif mute == 1 then
  2001. script.Parent.HideBar.Music.Text = "Unmute music"
  2002. end
  2003. script.Parent.HideBar.Music.MouseButton1Click:connect(function()
  2004. if mute == 0 then
  2005. mute = 1
  2006. CallServer("ChangeStat", "Mute", mute)
  2007. script.Parent.HideBar.Music.Text = "Unmute music"
  2008. elseif mute == 1 then
  2009. mute = 0
  2010. CallServer("ChangeStat", "Mute", mute)
  2011. script.Parent.HideBar.Music.Text = "Mute music"
  2012. end
  2013. end)
  2014. -- MAKING LEADERBOARD
  2015. function UpdateLeaderboard()
  2016. script.Parent.Leaderboard.Points.Text = "Your points: "..tostring(CallServer("GetStat", "Rep"))
  2017. for _, i in pairs(script.Parent.Leaderboard.Frame:GetChildren()) do
  2018. i:Destroy()
  2019. end
  2020. local pages = CallServer("GetLeaderBoard")
  2021. local getusernamefromid = require(script.GetUserNameFromId)
  2022. if pages ~= nil then
  2023. for num, i in pairs(pages) do
  2024. if num ~= nil and getusernamefromid(i.key) ~= nil and i.key ~= nil and i.value ~= nil then
  2025. local frame = Instance.new("Frame", script.Parent.Leaderboard.Frame)
  2026. frame.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
  2027. frame.Position = UDim2.new(0, 0, (num - 1) * 0.1, 0)
  2028. frame.Size = UDim2.new(1, 0, 0.1, 0)
  2029. frame.BorderColor3 = Color3.new(0,0,0)
  2030. frame.BorderSizePixel = 2
  2031. local textlabel = Instance.new("TextLabel", frame)
  2032. textlabel.BackgroundTransparency = 1
  2033. textlabel.Position = UDim2.new(0,0,0,0)
  2034. textlabel.Size = UDim2.new(1, 0, 1, 0)
  2035. textlabel.TextColor3 = Color3.new(1,1,1)
  2036. textlabel.TextScaled = true
  2037. textlabel.Font = Enum.Font.ArialBold
  2038. textlabel.Text = tostring(num)..". "..getusernamefromid(i.key).." ("..tostring(i.value).." points)"
  2039. end
  2040. end
  2041. end
  2042. end
  2043. local Camera = game:GetService("Workspace").CurrentCamera
  2044. local HasEggTracker = false
  2045. script.Parent.EggTracker.PurchaseFrame.TextButton.MouseButton1Click:Connect(function()
  2046. game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, 1565993463)
  2047. end)
  2048. script.Parent.EggTracker.Exit.MouseButton1Click:Connect(function()
  2049. if openedframe == "EggTracker" then
  2050. script.Parent.EggTracker:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2051. openedframe = ""
  2052. end
  2053. end)
  2054. local EggTrackerScalingObjects = {
  2055. script.Parent.EggTracker.EggArrow_1,
  2056. script.Parent.EggTracker.EggArrow_2,
  2057. script.Parent.EggTracker.EggArrow_3,
  2058. script.Parent.EggTracker.EggArrow_4,
  2059. script.Parent.EggTracker.EggArrow_5,
  2060. script.Parent.EggTracker.Radar,
  2061. script.Parent.EggTracker.PurchaseFrame.GamepassImg
  2062. }
  2063. function EggTracker_OnClick()
  2064. if openedframe == "EggTracker" then
  2065. script.Parent.EggTracker:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2066. openedframe = ""
  2067. elseif openedframe == "" then
  2068. script.Parent.EggTracker:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2069. openedframe = "EggTracker"
  2070. local Eggs = game:GetService("Workspace").Regens["Regen (Eggs)"]
  2071. while openedframe == "EggTracker" do
  2072. for _, obj in pairs(EggTrackerScalingObjects) do
  2073. obj.Size = UDim2.new(0, obj.AbsoluteSize.Y, obj.Size.Y.Scale, obj.Size.Y.Offset)
  2074. end
  2075. if HasEggTracker then
  2076. script.Parent.EggTracker.PurchaseFrame.Visible = false
  2077. if game.Players.LocalPlayer.Character ~= nil then
  2078. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2079. local CameraRay = Ray.new(Camera.CFrame.p, game.Players.LocalPlayer.Character.Torso.Position - Camera.CFrame.p)
  2080. local CameraAngle = math.atan2(CameraRay.Unit.Direction.X, CameraRay.Unit.Direction.Z)
  2081. local MaxEggs = 0
  2082. for _, Egg in pairs(Eggs:GetChildren()) do
  2083. if not Egg:IsA'Script' then
  2084. if Egg:FindFirstChild("HitBox") ~= nil then
  2085. MaxEggs = MaxEggs + 1
  2086. local Distance = (Egg.HitBox.Position - game.Players.LocalPlayer.Character.Torso.Position).Magnitude
  2087. local EggRay = Ray.new(Egg.HitBox.Position, game.Players.LocalPlayer.Character.Torso.Position - Egg.HitBox.Position)
  2088. local EggAngle = math.atan2(EggRay.Unit.Direction.X, EggRay.Unit.Direction.Z)
  2089. local Angle = math.deg(CameraAngle - EggAngle + math.cos(tick()) * 0.1)
  2090. local EggArrow = script.Parent.EggTracker["EggArrow_"..MaxEggs]
  2091. EggArrow.Rotation = Angle + 180
  2092. local rgb = Vector3.new(0, 255, 0):Lerp(Vector3.new(255, 0, 0), (Distance / 1000))
  2093. EggArrow.ImageColor3 = Color3.new(rgb.X / 255, rgb.Y / 255, rgb.Z / 255)
  2094. EggArrow.Visible = true
  2095. end
  2096. end
  2097. end
  2098. for Egg = MaxEggs + 1, 5 do
  2099. local EggArrow = script.Parent.EggTracker["EggArrow_"..Egg]
  2100. EggArrow.ImageColor3 = Color3.new(1,1,1)
  2101. EggArrow.Rotation = 0
  2102. EggArrow.Visible = false
  2103. end
  2104. if MaxEggs == 1 then
  2105. script.Parent.EggTracker.Count.Text = "There is currently "..MaxEggs.." egg on the map."
  2106. else
  2107. script.Parent.EggTracker.Count.Text = "There are currently "..MaxEggs.." eggs on the map."
  2108. end
  2109. end
  2110. end
  2111. else
  2112. script.Parent.EggTracker.PurchaseFrame.Visible = true
  2113. end
  2114. game:GetService("RunService").RenderStepped:wait()
  2115. end
  2116. end
  2117. end
  2118.  
  2119. script.Parent.HideBar.Leaderboard.MouseButton1Click:connect(function()
  2120. if openedframe == "LB" then
  2121. script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2122. openedframe = ""
  2123. elseif openedframe == "" then
  2124. script.Parent.Leaderboard:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2125. openedframe = "LB"
  2126. UpdateLeaderboard()
  2127. end
  2128. end)
  2129. script.Parent.Leaderboard.Exit.MouseButton1Click:connect(function()
  2130. script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2131. if openedframe == "LB" then
  2132. openedframe = ""
  2133. end
  2134. end)
  2135.  
  2136. -- PlrIB
  2137. local PlrIBInfos = {}
  2138. PlrIBInfos["SetText"] = {}
  2139. PlrIBInfos["SetTextColor"] = {}
  2140. if game.Players.LocalPlayer:IsInGroup(2586091) then
  2141. if game.Players.LocalPlayer:GetRankInGroup(2586091) >= 253 then
  2142. table.insert(PlrIBInfos["SetTextColor"], {Name = "Rank", Color = Color3.new(190/255, 23/255, 1/255)})
  2143. elseif game.Players.LocalPlayer:GetRankInGroup(2586091) >= 250 then
  2144. table.insert(PlrIBInfos["SetTextColor"], {Name = "Rank", Color = Color3.new(62/255, 36/255, 167/255)})
  2145. else
  2146. table.insert(PlrIBInfos["SetTextColor"], {Name = "Rank", Color = Color3.new(25/255, 255/255, 25/255)})
  2147. end
  2148. table.insert(PlrIBInfos["SetText"], {Name = "Rank", Text = "[ " .. game.Players.LocalPlayer:GetRoleInGroup(2586091) .. " ]"})
  2149. else
  2150. table.insert(PlrIBInfos["SetText"], {Name = "Rank", Text = ""})
  2151. end
  2152.  
  2153. if not CallServer("NPlrIB", true, PlrIBInfos) then print("CAN'T SENT BILLBOARD GUI!") end
  2154.  
  2155. spawn(function()
  2156. while true do
  2157. if game.Players.LocalPlayer.Character ~= nil then
  2158. if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
  2159. local char = game.Players.LocalPlayer.Character
  2160. local hp = char.Humanoid.Health
  2161. local maxhp = char.Humanoid.MaxHealth
  2162. if 0.55 * (hp / maxhp) > 0.08 then
  2163. if not ib:FindFirstChild("HP") then break end
  2164. ib.HP:TweenSize(UDim2.new(0.55 * (hp / maxhp), 0, -0.15, 0), "Out", "Quad", 1, true)
  2165. else
  2166. if not ib:FindFirstChild("HP") then break end
  2167. ib.HP:TweenSize(UDim2.new(0.08, 0, -0.15, 0), "Out", "Quad", 1, true)
  2168. end
  2169. if not ib:FindFirstChild("HPText") then break end
  2170. ib.HPText.Text = "HP "..tostring(hp).."/"..tostring(maxhp)
  2171. local xp = Stats.GetStat("XP")
  2172. local lvl = CallServer("GetLVL")
  2173. if not ib:FindFirstChild("XPText") then break end
  2174. if lvl ~= 100 then
  2175. if not ib:FindFirstChild("XPText") then break end
  2176. ib.XPText.Text = "XP "..tostring(xp).."/"..tostring(lvl * 2)
  2177. if 0.55 * (xp / (lvl * 2)) > 0.04 then
  2178. if not ib:FindFirstChild("XP") then break end
  2179. ib.XP:TweenSize(UDim2.new(0.55 * (xp / (lvl * 2)), 0, -0.15, 0), "Out", "Quad", 1, true)
  2180. else
  2181. if not ib:FindFirstChild("XP") then break end
  2182. ib.XP:TweenSize(UDim2.new(0.04, 0, -0.15, 0), "Out", "Quad", 1, true)
  2183. end
  2184. else
  2185. if not ib:FindFirstChild("XPText") then break end
  2186. ib.XPText.Text = "Full level reached"
  2187. if not ib:FindFirstChild("XP") then break end
  2188. ib.XP:TweenSize(UDim2.new(0.55, 0, -0.15, 0), "Out", "Quad", 1, true)
  2189. end
  2190.  
  2191. if not ib:FindFirstChild("Level") then break end
  2192. if not ib:FindFirstChild("Cash") then break end
  2193. if not ib:FindFirstChild("BP") then break end
  2194. if not ib:FindFirstChild("PB") then break end
  2195. ib.Level.Text = "LVL " .. lvl
  2196. ib.Cash.Text = Stats.GetStat("Cash") .. " PD"
  2197. ib.PB.Text = Stats.GetStat("PokeBux") .. " PB"
  2198. ib.BP.Text = Stats.GetStat("BP") .. " BP"
  2199. -- PlrIB
  2200. local PlrIBInfos = {}
  2201. PlrIBInfos["SetText"] = {}
  2202. PlrIBInfos["TweenSize"] = {}
  2203. table.insert(PlrIBInfos["SetText"], {Name = "HPText", Text = "HP "..tostring(hp).."/"..tostring(maxhp)})
  2204. if 1 * (hp / maxhp) > 0.08 then
  2205. CallServer("PlrIB_TweenSize", "HP", UDim2.new(1 * (hp / maxhp), 0, 0.25, 0))
  2206. else
  2207. CallServer("PlrIB_TweenSize", "HP", UDim2.new(0.08, 0, 0.25, 0))
  2208. end
  2209. local cpvp = Stats.GetStat("PvP")
  2210. if cpvp == 1 then
  2211. if pvp == 0 then
  2212. pvp = 1
  2213. script.Parent.HideBar.PvP.Text = "Disable PvP"
  2214. end
  2215. table.insert(PlrIBInfos["SetText"], {Name = "PvP", Text = "[PVP]"})
  2216. else
  2217. if pvp == 1 then
  2218. pvp = 0
  2219. script.Parent.HideBar.PvP.Text = "Enable PvP"
  2220. end
  2221. table.insert(PlrIBInfos["SetText"], {Name = "PvP", Text = ""})
  2222. end
  2223. table.insert(PlrIBInfos["SetText"], {Name = "PlrName", Text = game.Players.LocalPlayer.Name .. " (Level "..lvl..")"})
  2224. CallServer("NPlrIB", false, PlrIBInfos)
  2225. HasEggTracker = Stats.GetStat("EggTracker") == 1
  2226. end
  2227. end
  2228. wait()
  2229. end
  2230. end)
  2231. function event.OnClientInvoke(...)
  2232. local args = {...}
  2233. if args[1] == "SHOP" then
  2234. if openedframe ~= "TRADE" then
  2235. if args[2] == "OPEN" then
  2236. script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2237. script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2238. script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2239. script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2240. if game.Players.LocalPlayer.Character then
  2241. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2242. game.Players.LocalPlayer.Character.Torso.Anchored = true
  2243. end
  2244. end
  2245. openedframe = "SHOP"
  2246. script.Parent.Shop:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2247. SetupShop(args[3])
  2248. elseif args[2] == "CLOSE" then
  2249. if openedframe == "SHOP" then
  2250. openedframe = ""
  2251. if game.Players.LocalPlayer.Character then
  2252. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2253. game.Players.LocalPlayer.Character.Torso.Anchored = false
  2254. end
  2255. end
  2256. script.Parent.Shop:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2257. end
  2258. end
  2259. end
  2260. elseif args[1] == "QUESTS" then
  2261. if openedframe ~= "TRADE" then
  2262. if args[2] == "OPEN" then
  2263. script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2264. script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2265. script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2266. script.Parent.Shop:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2267. if game.Players.LocalPlayer.Character then
  2268. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2269. game.Players.LocalPlayer.Character.Torso.Anchored = true
  2270. end
  2271. end
  2272. openedframe = "QUESTS"
  2273. script.Parent.Quests:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2274. SetupQuest(args[3])
  2275. elseif args[2] == "CLOSE" then
  2276. if openedframe == "QUESTS" then
  2277. openedframe = ""
  2278. if game.Players.LocalPlayer.Character then
  2279. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2280. game.Players.LocalPlayer.Character.Torso.Anchored = false
  2281. end
  2282. end
  2283. script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
  2284. end
  2285. end
  2286. end
  2287. elseif args[1] == "ShowReward" then
  2288. game.Players.LocalPlayer.PlayerGui.ShowReward.Value = args[2]
  2289. elseif args[1] == "ClearRBXLInventory" then
  2290. for _, i in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  2291. if i:IsA'Tool' or i:IsA'HopperBin' then
  2292. i:Destroy()
  2293. end
  2294. end
  2295. for _, i in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
  2296. if i:IsA'Tool' or i:IsA'HopperBin' then
  2297. i:Destroy()
  2298. end
  2299. end
  2300. elseif args[1] == "TradePending" then
  2301. Trade_Pending(args[2])
  2302. elseif args[1] == "TradeStarted" then
  2303. Trade_Started(args[2])
  2304. elseif args[1] == "TradeChanged" then
  2305. Trade_Changed(args[2])
  2306. elseif args[1] == "TradeEnded" then
  2307. Trade_Ended(args[2])
  2308. elseif args[1] == "BattlePending" then
  2309. local responded = false
  2310. local function Respond(state)
  2311. if not responded then
  2312. responded = true
  2313. CallServer("Battle", "Respond", args[2], state)
  2314. end
  2315. end
  2316. if CheckAcceptionSupport() then
  2317. local currentacceptationid = AddOnAcception(
  2318. function(state)
  2319. Respond(state)
  2320. return "Successfuly "..(state and "accepted" or "declined").." the request!"
  2321. end,
  2322. "You have received trade request from "..args[2]
  2323. )
  2324. wait(16)
  2325. if accfuncid == currentacceptationid then
  2326. ResetOnAcceptation()
  2327. end
  2328. Respond(false)
  2329. else
  2330. local callback = Instance.new("BindableFunction")
  2331. callback.Parent = script
  2332. callback.Name = "BattleCallback"
  2333. callback.OnInvoke = function(answer)
  2334. local accepted = answer == "Accept"
  2335. Respond(accepted)
  2336. end
  2337. game.StarterGui:SetCore("SendNotification", {
  2338. Title = "Battle request",
  2339. Text = "You have received battle request from "..args[2],
  2340. Icon = "",
  2341. Duration = 10,
  2342. Callback = callback,
  2343. Button1 = "Accept",
  2344. Button2 = "Decline"
  2345. })
  2346. wait(11)
  2347. Respond(false)
  2348. end
  2349. elseif args[1] == "BossFightLeaveNotification" then
  2350. local responded = false
  2351. local function Respond(state)
  2352. if not responded then
  2353. responded = true
  2354. CallServer("BossFightLeaveRespond", state, args[2])
  2355. end
  2356. end
  2357. if CheckAcceptionSupport() then
  2358. local currentacceptationid = AddOnAcception(
  2359. function(state)
  2360. Respond(state)
  2361. return "Successfuly "..(state and "accepted" or "declined").." the request!"
  2362. end,
  2363. "Do you really want to leave the boss fight?"
  2364. )
  2365. wait(16)
  2366. if accfuncid == currentacceptationid then
  2367. ResetOnAcceptation()
  2368. end
  2369. Respond(false)
  2370. else
  2371. local callback = Instance.new("BindableFunction")
  2372. callback.Parent = script
  2373. callback.Name = "BossFightLeaveCallback"
  2374. callback.OnInvoke = function(answer)
  2375. local accepted = answer == "Accept"
  2376. Respond(accepted)
  2377. end
  2378. game.StarterGui:SetCore("SendNotification", {
  2379. Title = "Boss fight",
  2380. Text = "Do you really want to leave the boss fight?",
  2381. Icon = "",
  2382. Duration = 10,
  2383. Callback = callback,
  2384. Button1 = "Accept",
  2385. Button2 = "Decline"
  2386. })
  2387. wait(11)
  2388. Respond(false)
  2389. end
  2390. elseif args[1] == "BattleNotification" then
  2391. game.StarterGui:SetCore("SendNotification", {
  2392. Title = "Battle request",
  2393. Text = args[2],
  2394. Icon = "",
  2395. Duration = 5,
  2396. })
  2397. elseif args[1] == "ACCEPTION" then
  2398. return OnAccepted(args[2])
  2399. end
  2400. end
  2401. end
  2402.  
  2403. function OpenCGui()
  2404. local curpokemon = nil
  2405. local curcategory = nil
  2406. local introf = gui.Intro
  2407. introf.Visible = true
  2408. local canusep = false
  2409. -- Prepare pokemon :D
  2410. local function View3D(model)
  2411. -- 3D View
  2412. local active = true
  2413. local CameraCFrame = CFrame.new(19.8090763, 80.9669266, 3511.29883, 0.0311436951, -0.339099914, 0.94023478, -0, 0.940691113, 0.339264482, -0.999514937, -0.0105659496, 0.0292965956)
  2414. local Mod = require(script["3DModule"])
  2415. local Model3D = Mod:Attach3D(gui["3DView"].Holder, model)
  2416. Model3D:SetActive(true)
  2417. game:GetService("RunService").RenderStepped:connect(function()
  2418. if active then
  2419. local fullrot = math.pi * 2
  2420. local currot = tick()%fullrot
  2421. Model3D:SetCFrame(CFrame.Angles(0, currot, 0))
  2422. end
  2423. end)
  2424. game.Workspace.CurrentCamera.CameraType = "Scriptable"
  2425. game.Workspace.CurrentCamera.CoordinateFrame = CameraCFrame
  2426. game.Workspace.CurrentCamera.Focus = Model3D.Object3D:GetChildren()[1].CFrame
  2427. introf:TweenPosition(UDim2.new(0, 0, -3, 0), "Out", "Quad", 1, true)
  2428. return function()
  2429. introf:TweenPosition(UDim2.new(0, 0, -1, 0), "Out", "Quad", 1, true, function()
  2430. active = false
  2431. game.Workspace.CurrentCamera.CameraType = "Custom"
  2432. game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
  2433. Model3D:SetActive(false)
  2434. Model3D:End()
  2435. end)
  2436. end
  2437. end
  2438. local function ChoosePokemon(to, name, canuse)
  2439. canusep = canuse
  2440. local datas = script.Pokemon[to][name]
  2441. curpokemon = name
  2442. if canuse == true then
  2443. introf.Informations.Image.Image = "rbxassetid://"..datas.ImageId.Value
  2444. introf.Informations.Image.ImageColor3 = Color3.new(1,1,1)
  2445. local lvl = CallServer("GetStat", datas.Stat.Value)
  2446. if lvl then introf.Informations.Image.LVL.Text = "Level "..lvl end
  2447. else
  2448. introf.Informations.Image.Image = "rbxassetid://"..datas.ImageId.Value
  2449. introf.Informations.Image.ImageColor3 = Color3.new(0,0,0)
  2450. introf.Informations.Image.LVL.Text = ""
  2451. end
  2452. PokemonDatas = {}
  2453. PokemonDatas.Category = to
  2454. PokemonDatas.PokemonName = name
  2455. introf.Informations.Image.Block.Visible = false
  2456. introf.Informations:FindFirstChild("Name").Text = canuse and datas.Name or ""
  2457. end
  2458. local pokes = require(script.Pokemon.Sorter)
  2459. local debounce = false
  2460. local function ChangePokemonCategory(to)
  2461. if debounce == false then
  2462. debounce = true
  2463. for _, i in pairs(introf.Choose.Pokemon:GetChildren()) do
  2464. i:Destroy()
  2465. end
  2466. local YY = math.floor(#pokes[to] / 6)
  2467. if #pokes[to] % 6 ~= 0 then
  2468. YY = YY + 1
  2469. end
  2470. local YC = 1 / YY
  2471. if YY <= 5 then
  2472. YC = 0.2
  2473. end
  2474. local pcur = 1
  2475. for id, name in pairs(pokes[to]) do
  2476. local i = script.Pokemon[to]:FindFirstChild(name)
  2477. local num = pcur
  2478. num = num - 1
  2479. local position = num % 6
  2480. local line = (num-position) / 6 -- line = (id - 1 - (id - 1 % 6)) / 6 (should give you a multiple of 6 that is then divided by 6)
  2481. local Button = Instance.new("ImageButton")
  2482. Button.BackgroundTransparency = 1
  2483. Button.Name = i.Name
  2484. local canuse = false
  2485. local Text = Instance.new("TextLabel")
  2486. Text.BackgroundTransparency = 1
  2487. Text.Name = i.Name
  2488. Text.Text = ""
  2489. Text.Size = UDim2.new(0.1, 0, YC / 4, 0)
  2490. Text.TextScaled = false
  2491. Text.ZIndex = 8
  2492. Text.Parent = introf.Choose.Pokemon
  2493. Text.Position = UDim2.new((((position) * 1.5)/10) + 0.05, 0, (line * YC) + (YC / 4) + (YC / 2), 0)
  2494. Text.TextColor3 = Color3.new(0, 0, 0)
  2495. Text.Font = Enum.Font.ArialBold
  2496. Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
  2497. Button.ImageColor3 = Color3.new(0,0,0)
  2498. if i.Stat.Value == "" then
  2499. canuse = true
  2500. Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
  2501. Button.ImageColor3 = Color3.new(1,1,1)
  2502. Text.Text = i.Name
  2503. elseif string.sub(i.Stat.Value, 1, 5) == "BADGE" then
  2504. if CallServer("UserHasBadge", tonumber(string.sub(i.Stat.Value, 7))) then
  2505. canuse = true
  2506. Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
  2507. Button.ImageColor3 = Color3.new(1,1,1)
  2508. Text.Text = i.Name
  2509. end
  2510. elseif string.sub(i.Stat.Value, 1, 2) == "GP" then
  2511. if CallServer("UserHasGamepass", tonumber(string.sub(i.Stat.Value, 4))) then
  2512. canuse = true
  2513. Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
  2514. Button.ImageColor3 = Color3.new(1,1,1)
  2515. Text.Text = i.Name
  2516. end
  2517. elseif string.sub(i.Stat.Value, 1, 5) == "GROUP" then
  2518. if CallServer("IsInGroup", tonumber(string.sub(i.Stat.Value, 7))) then
  2519. canuse = true
  2520. Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
  2521. Button.ImageColor3 = Color3.new(1,1,1)
  2522. Text.Text = i.Name
  2523. end
  2524. else
  2525. local curstat = Stats.GetStat(i.Stat.Value)
  2526. if curstat and curstat ~= 0 then
  2527. Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
  2528. Button.ImageColor3 = Color3.new(1,1,1)
  2529. canuse = true
  2530. Text.Text = i.Name
  2531. end
  2532. end
  2533. Button.Size = UDim2.new(0.1, 0, YC / 2, 0)
  2534. Button.Position = UDim2.new((((position) * 1.5)/10) + 0.05, 0, (line * YC) + (YC / 4), 0)
  2535. Button.Parent = introf.Choose.Pokemon
  2536. Button.ZIndex = 8
  2537. Button.MouseButton1Click:connect(function() ChoosePokemon(to, i.Name, canuse) end)
  2538. if ((line + 1) * 0.2) < 1 then
  2539. introf.Choose.Pokemon.CanvasSize = UDim2.new(0, 0, 0, 0)
  2540. else
  2541. introf.Choose.Pokemon.CanvasSize = UDim2.new(0, 0, ((line + 1) * 0.2), 0)
  2542. end
  2543. pcur = pcur + 1
  2544. end
  2545. curcategory = to
  2546. debounce = false
  2547. end
  2548. end
  2549. local minimalcanvasyscale = 1
  2550. local allnum = 0
  2551. for num in pairs(script.Pokemon:GetChildren()) do
  2552. if num > allnum then
  2553. allnum = num
  2554. end
  2555. end
  2556. local YC = 1 / #script.Pokemon:GetChildren()
  2557. if #script.Pokemon:GetChildren() <= 5 then
  2558. YC = 0.2
  2559. end
  2560. for num = 1, #script.Pokemon:GetChildren(), 1 do
  2561. for _, i in pairs(script.Pokemon:GetChildren()) do
  2562. if string.sub(i.Name, 1, 2) == tostring(num + 10) then
  2563. local button = Instance.new("TextButton")
  2564. button.BackgroundTransparency = 1
  2565. button.Position = UDim2.new(0, 0, (num - 1) * YC, 0)
  2566. button.Size = UDim2.new(1, 0, YC, 0)
  2567. button.Text = string.sub(i.Name, 3)
  2568. button.Name = i.Name
  2569. button.MouseButton1Click:connect(function() ChangePokemonCategory(i.Name) end)
  2570. button.ZIndex = 8
  2571. button.Parent = introf.Choose.Categories
  2572. button.Font = Enum.Font.Creepster
  2573. button.TextScaled = true
  2574. button.TextColor3 = Color3.new(0, 0, 0)
  2575. if num * YC < 1 then
  2576. introf.Choose.Categories.CanvasSize = UDim2.new(0,0,0,0)
  2577. else
  2578. introf.Choose.Categories.CanvasSize = UDim2.new(0,0, num * YC, 0)
  2579. end
  2580. end
  2581. end
  2582. end
  2583. spawn(function() for _, i in pairs(script.Pokemon:GetChildren()) do if string.sub(i.Name, 1, 1) == "1" then ChangePokemonCategory(i.Name) end end end)
  2584. local play = "play"
  2585. local choosenevolve = nil
  2586. introf.Informations.Play.MouseButton1Click:connect(function()
  2587. if play == "play" then
  2588. if canusep and curpokemon ~= nil and curcategory ~= nil then
  2589. introf.Choose:TweenPosition(UDim2.new(-1, 0, 0.54, 0), "Out", "Quad", 1, true)
  2590. introf.Informations.Play:TweenPosition(UDim2.new(2, 0, 0.8, 0), "Out", "Quad", 1, true)
  2591. wait(1)
  2592. local textlabel = Instance.new("TextLabel", introf.Play)
  2593. textlabel.TextColor3 = Color3.new(0,0,0)
  2594. textlabel.BackgroundTransparency = 1
  2595. textlabel.Position = UDim2.new(0,0,0,0)
  2596. textlabel.Size = UDim2.new(1, 0, 0.8, 0)
  2597. textlabel.TextScaled = true
  2598. textlabel.Text = "Needs: \n"
  2599. textlabel.TextYAlignment = "Top"
  2600. textlabel.TextXAlignment = "Center"
  2601. textlabel.ZIndex = 10
  2602. local decoded = nil
  2603. if script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]:FindFirstChild("Need") then
  2604. decoded = mod(script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName].Need.Value)
  2605. end
  2606. if decoded ~= nil then
  2607. for _, i in pairs(decoded) do
  2608. if i[1] == "LVL" then
  2609. textlabel.Text = textlabel.Text .. "Level " .. i[2]
  2610. elseif i[1] == "C" then
  2611. for id, v in pairs(mod2(i[2])) do
  2612. if id ~= 1 then
  2613. textlabel.Text = textlabel.Text .. " or "
  2614. end
  2615. textlabel.Text = textlabel.Text .. v .. " x" .. i[3]
  2616. end
  2617. elseif i[1] == "T" then
  2618. for id, v in pairs(mod2(i[2])) do
  2619. if id ~= 1 then
  2620. textlabel.Text = textlabel.Text .. " or "
  2621. end
  2622. textlabel.Text = textlabel.Text .. v .. " x" .. i[3]
  2623. end
  2624. textlabel.Text = textlabel.Text .. " (will be taken)"
  2625. elseif i[1] == "DAY" then
  2626. textlabel.Text = textlabel.Text .. "Day needed"
  2627. elseif i[1] == "NIGHT" then
  2628. textlabel.Text = textlabel.Text .. "Night needed"
  2629. end
  2630. textlabel.Text = textlabel.Text .. "\n"
  2631. end
  2632. else
  2633. textlabel.Text = textlabel.Text .. "No needs"
  2634. end
  2635. introf.Play:TweenPosition(UDim2.new(0.02, 0, 0.54, 0), "Out", "Quad", 1, true)
  2636. introf.Informations.Play.Text = "Back"
  2637. introf.Informations.Pokedex.Text = "Spawn"
  2638. introf.Informations.Pokedex:TweenPosition(UDim2.new(0, 0, 0.64, 0), "Out", "Quad", 1, true)
  2639. introf.Informations.Play:TweenPosition(UDim2.new(0, 0, 0.8, 0), "Out", "Quad", 1, true)
  2640. play = "backchoosing"
  2641. end
  2642. elseif play == "backchoosing" then
  2643. introf.Play:TweenPosition(UDim2.new(-1, 0, 0.54, 0), "Out", "Quad", 1, true)
  2644. introf.Informations.Play:TweenPosition(UDim2.new(2, 0, 0.8, 0), "Out", "Quad", 1, true)
  2645. introf.Informations.Pokedex:TweenPosition(UDim2.new(2, 0, 0.64, 0), "Out", "Quad", 1, true)
  2646. wait(1)
  2647. for _, i in pairs(introf.Play:GetChildren()) do
  2648. i:Destroy()
  2649. end
  2650. introf.Choose:TweenPosition(UDim2.new(0.02, 0, 0.54, 0), "Out", "Quad", 1, true)
  2651. introf.Informations.Play.Text = "Next"
  2652. introf.Informations.Pokedex.Text = ""
  2653. introf.Informations.Play:TweenPosition(UDim2.new(0, 0, 0.8, 0), "Out", "Quad", 1, true)
  2654. play = "play"
  2655. end
  2656. end)
  2657. local spawndebounce = false
  2658. introf.Informations.Pokedex.MouseButton1Click:connect(function()
  2659. if play == "backchoosing" then
  2660. if spawndebounce == false then
  2661. spawndebounce = true
  2662. if canusep then
  2663. local decoded = nil
  2664. local requirementspass = true -- TO CHANGE
  2665. if script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]:FindFirstChild("Need") then
  2666. decoded = mod(script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName].Need.Value)
  2667. end
  2668. local stat = script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]:FindFirstChild("Stat")
  2669. if decoded ~= nil then
  2670. for _, i in pairs(decoded) do
  2671. if i[1] == "LVL" then
  2672. if stat then
  2673. if CallServer("GetLVL", stat.Value) < tonumber(i[2]) then
  2674. requirementspass = false
  2675. end
  2676. end
  2677. elseif i[1] == "C" then
  2678. local passed = false
  2679. for id, v in pairs(mod2(i[2])) do
  2680. if Stats.GetStat(v) >= tonumber(i[3]) then
  2681. passed = true
  2682. end
  2683. end
  2684. if not passed then requirementspass = false end
  2685. elseif i[1] == "T" then
  2686. local passed = false
  2687. for id, v in pairs(mod2(i[2])) do
  2688. if Stats.GetStat(v) >= tonumber(i[3]) then
  2689. passed = true
  2690. end
  2691. end
  2692. if not passed then requirementspass = false end
  2693. elseif i[1] == "DAY" then
  2694. if CallServer("DayNight") ~= "D" then
  2695. requirementspass = false
  2696. end
  2697. elseif i[1] == "NIGHT" then
  2698. if CallServer("DayNight") ~= "N" then
  2699. requirementspass = false
  2700. end
  2701. end
  2702. end
  2703. end
  2704. -- CHECKING REQUIREMENTS
  2705. if requirementspass then
  2706. -- CHOOSING SPAWN LOCATION
  2707. local continue = false
  2708. local sc = script.Parent.SpawnChoosing
  2709. for _, i in pairs(game.Workspace.CurrentCamera:GetChildren()) do
  2710. if i:IsA'BlurEffect' then
  2711. i:Destroy()
  2712. end
  2713. end
  2714. local cam = game.Workspace.CurrentCamera
  2715. local lastcampos = cam.CFrame
  2716. local blur = Instance.new("BlurEffect")
  2717. blur.Size = 0
  2718. blur.Parent = cam
  2719.  
  2720. function round(num, idp)
  2721. local mult = 10^(idp or 0)
  2722. return math.floor(num * mult + 0.5) / mult
  2723. end
  2724. sc:TweenPosition(UDim2.new(0.2, 0, 0.7, 0), "Out", "Quad", 1, true)
  2725. introf:TweenPosition(UDim2.new(0, 0, -3, 0), "Out", "Quad", 1, true, function() introf:Destroy() end)
  2726. local ccamera = game.Workspace.CurrentCamera
  2727. local datas = script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]
  2728. ccamera.CameraType = "Scriptable"
  2729.  
  2730. local spawns = {}
  2731. local spawnscframes
  2732. repeat wait() spawnscframes = CallServer("GetSpawns") until spawnscframes
  2733. for i, _ in pairs(spawnscframes) do
  2734. spawns[i] = i
  2735. end
  2736.  
  2737. local current = 1
  2738.  
  2739. ccamera.CoordinateFrame = CFrame.new((spawnscframes[spawns[current]] * CFrame.new(0, 15, 15)).p, spawnscframes[spawns[current]].p)
  2740.  
  2741.  
  2742. local lasti = 0
  2743. local debounce = true
  2744. local function SPAWN()
  2745. if game.Players.LocalPlayer.Character ~= nil then
  2746. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2747. game.Players.LocalPlayer.Character.Torso.Anchored = false
  2748. end
  2749. end
  2750. blur:Destroy()
  2751. sc:TweenPosition(UDim2.new(0.2, 0, 1.5, 0), "Out", "Quad", 1, true)
  2752. local old = ccamera.CoordinateFrame
  2753. ccamera.CameraType = "Custom"
  2754. spawn(function()
  2755. for i = 1, 25, 1 do
  2756. ccamera.CameraType = "Custom"
  2757. wait(0.1)
  2758. end
  2759. end)
  2760. ccamera.CoordinateFrame = old
  2761. local response = CallServer("SpawnPokemon", PokemonDatas, spawns[current])
  2762. if response then
  2763. -- TAKE REQUIRED ITEMS
  2764. if decoded ~= nil then
  2765. for _, i in pairs(decoded) do
  2766. if i[1] == "T" then
  2767. for id, v in pairs(mod2(i[2])) do
  2768. if Stats.GetStat(v) >= tonumber(i[3]) then
  2769. CallServer("ChangeStat", v, Stats.GetStat(v) - tonumber(i[3]))
  2770. break
  2771. end
  2772. end
  2773. end
  2774. end
  2775. end
  2776. local ef, hb, ib = script.Parent.Expand, script.Parent.HideBar, script.Parent.InfoBar
  2777. ef.Visible = true
  2778. hb.Visible = true
  2779. ib.Visible = true
  2780. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
  2781. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
  2782. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
  2783. if CallServer("GetStat", "KeepPvP") == 1 then
  2784. CallServer("ChangeStat", "PvP", 1)
  2785. else
  2786. CallServer("ChangeStat", "PvP", 0)
  2787. end
  2788. gui.ChatFrame.LocalChatScript.Disabled = false
  2789. script.Parent.InfoBar:FindFirstChild("Name").Text = curpokemon
  2790. game:GetService("UserInputService").ModalEnabled = false
  2791. spawn(function() SetupHUD(curcategory, curpokemon) end)
  2792. local Shown = 0
  2793. repeat
  2794. Shown = 0
  2795. if mobileinterface then
  2796. ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
  2797. hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
  2798. ib:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
  2799. else
  2800. ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
  2801. hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
  2802. ib:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
  2803. end
  2804. wait(1.2)
  2805. until Shown == 3
  2806. else
  2807. if game.Players.LocalPlayer.Character ~= nil then
  2808. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2809. game.Players.LocalPlayer.Character.Torso.Anchored = true
  2810. end
  2811. end
  2812. spawndebounce = false
  2813. end
  2814. end
  2815.  
  2816.  
  2817. function LOAD(prev)
  2818. debounce = false
  2819. local this = current
  2820. local startcframe = game.Workspace.CurrentCamera.CoordinateFrame
  2821. local startfocus = spawnscframes[spawns[prev]]
  2822. if game.Players.LocalPlayer.Character ~= nil then
  2823. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2824. game.Players.LocalPlayer.Character.Torso.Anchored = true
  2825. end
  2826. end
  2827. for i = 1, 60 do
  2828. game.Workspace.CurrentCamera.CameraType = "Scriptable"
  2829. game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(startcframe.p:lerp((spawnscframes[spawns[current]] * CFrame.Angles(0, math.rad(lasti), 0) * CFrame.new(0, 15, 15)).p,i/60), startfocus.p:lerp(spawnscframes[spawns[current]].p,i/60))
  2830. if game.Players.LocalPlayer.Character ~= nil then
  2831. if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
  2832. local camX, camY, camZ = game.Workspace.CurrentCamera.CoordinateFrame.X, game.Workspace.CurrentCamera.CoordinateFrame.Y, game.Workspace.CurrentCamera.CoordinateFrame.Z
  2833. game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(camX, camY, camZ) * CFrame.new(0, -100, 0)
  2834. end
  2835. end
  2836. game:GetService("RunService").RenderStepped:wait()
  2837. end
  2838. debounce = true
  2839. while this == current and not continue do
  2840. if lasti > 359.5 then lasti = 0 end
  2841. for i = lasti, 360, 0.5 do
  2842. lasti = i
  2843. game.Workspace.CurrentCamera.CameraType = "Scriptable"
  2844. game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new(((spawnscframes[spawns[current]] * CFrame.Angles(0, math.rad(i), 0) * CFrame.new(0, 15, 15))).p , spawnscframes[spawns[current]].p)
  2845. if current ~= this or continue then
  2846. break
  2847. end
  2848. local cx, cy, cz = cam.CFrame:toEulerAnglesXYZ()
  2849. local lx, ly, lz = lastcampos:toEulerAnglesXYZ()
  2850. local camdist = (
  2851. -- it needs to be rounded this way because of strange floating point
  2852. -- errors that happen with the camera facing directly up or down
  2853. Vector3.new(round(cx,2),round(cy,2),round(cz,2)) -
  2854. Vector3.new(round(lx,2),round(ly,2),round(lz,2))
  2855. ).magnitude
  2856. blur.Size = camdist * 10
  2857. lastcampos = cam.CFrame
  2858. wait(1/60)
  2859. end
  2860. end
  2861. end
  2862.  
  2863. spawn(function()
  2864. sc.Previous.MouseButton1Click:connect(function()
  2865. if debounce then
  2866. local prev = current
  2867. current = current - 1
  2868. if current == 0 then current = #spawns end
  2869. LOAD(prev)
  2870. end
  2871. end)
  2872. sc.Next.MouseButton1Click:connect(function()
  2873. if debounce then
  2874. local prev = current
  2875. current = current + 1
  2876. if current == #spawns + 1 then current = 1 end
  2877. LOAD(prev)
  2878. end
  2879. end)
  2880. end)
  2881. sc.Spawn.MouseButton1Click:connect(function()
  2882. if debounce then
  2883. debounce = false
  2884. continue = true
  2885. SPAWN()
  2886. end
  2887. end)
  2888. LOAD(current)
  2889. else
  2890. spawndebounce = false
  2891. end
  2892. else
  2893. spawndebounce = false
  2894. end
  2895. end
  2896. end
  2897. end)
  2898. introf.Informations.Image["3DView"].MouseButton1Click:connect(function()
  2899. if canusep == true then
  2900. local pokemon = CallServer("Get3DPokemon", curpokemon)
  2901. if pokemon ~= nil then
  2902. local turnofffunc = View3D(pokemon)
  2903. local turnoffbutton = Instance.new("TextButton", script.Parent)
  2904. turnoffbutton.Text = "Back"
  2905. turnoffbutton.BackgroundTransparency = 1
  2906. turnoffbutton.Font = Enum.Font.ArialBold
  2907. turnoffbutton.TextScaled = true
  2908. turnoffbutton.TextColor3 = Color3.new(0, 0, 0)
  2909. turnoffbutton.Size = UDim2.new(0.3, 0, 0.25, 0)
  2910. turnoffbutton.Position = UDim2.new(-0.5, 0, 0.7, 0)
  2911. turnoffbutton:TweenPosition(UDim2.new(0.05, 0, 0.7, 0), "Out", "Quad", 1, true)
  2912. turnoffbutton.MouseButton1Click:connect(function()
  2913. turnoffbutton:TweenPosition(UDim2.new(-0.5, 0, 0.7, 0), "Out", "Quad", 1, true, function()
  2914. turnoffbutton:Destroy()
  2915. pokemon:Destroy()
  2916. end)
  2917. turnofffunc()
  2918. end)
  2919. turnoffbutton.Name = "TurnOff3DView"
  2920. end
  2921. end
  2922. end)
  2923. introf.Choose:TweenPosition(UDim2.new(0.02, 0, 0.54, 0), "Out", "Quad", 1, true)
  2924. introf.Informations:TweenPosition(UDim2.new(0.61, 0, 0.54, 0), "Out", "Quad", 1, true)
  2925. end
  2926.  
  2927. function SetupSGui()
  2928. local SButtonsDebounce = false
  2929. gui.Intro.Visible = true
  2930. local function SetupOThings()
  2931.  
  2932. -- Choosing menu
  2933.  
  2934. OpenCGui()
  2935. end
  2936.  
  2937. local run = true
  2938.  
  2939. local Img = Instance.new("ImageLabel", gui)
  2940. Img.Name = "MenuImage"
  2941. Img.BackgroundTransparency = 1
  2942. if ReturnConf("MenuImages")[1] then Img.Image = ReturnConf("MenuImages")[1] end
  2943. Img.Size = UDim2.new(0.6, 0, 0.3, 0)
  2944. Img.Position = UDim2.new(0.2, 0, -2, 0)
  2945. Img:TweenPosition(UDim2.new(0.2, 0, 0.15, 0), "Out", "Quad", 1, true)
  2946. Img.ZIndex = 6
  2947.  
  2948. local buttons = {} -- Buttons Holder
  2949. -- Play
  2950. buttons.Play = Instance.new("TextButton", gui)
  2951. buttons.Play.BackgroundTransparency = 1
  2952. buttons.Play.Name = "Play"
  2953. buttons.Play.TextScaled = true
  2954. buttons.Play.TextColor3 = Color3.new(255, 255, 255)
  2955. buttons.Play.TextStrokeColor3 = Color3.new(0, 0, 0)
  2956. buttons.Play.TextStrokeTransparency = 0
  2957. buttons.Play.Font = Enum.Font.ArialBold
  2958. buttons.Play.Text = "Play"
  2959. buttons.Play.ZIndex = 6
  2960. buttons.Play.Position = UDim2.new(0.4, 0, 1.5, 0)
  2961. buttons.Play.Size = UDim2.new(0.2, 0, 0.1, 0)
  2962. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
  2963. -- Settings
  2964. buttons.Settings = Instance.new("TextButton", gui)
  2965. buttons.Settings.BackgroundTransparency = 1
  2966. buttons.Settings.Name = "Settings"
  2967. buttons.Settings.TextScaled = true
  2968. buttons.Settings.TextColor3 = Color3.new(255, 255, 255)
  2969. buttons.Settings.TextStrokeColor3 = Color3.new(0, 0, 0)
  2970. buttons.Settings.TextStrokeTransparency = 0
  2971. buttons.Settings.Font = Enum.Font.ArialBold
  2972. buttons.Settings.Text = "Settings"
  2973. buttons.Settings.ZIndex = 6
  2974. buttons.Settings.Position = UDim2.new(0.4, 0, 1.6, 0)
  2975. buttons.Settings.Size = UDim2.new(0.2, 0, 0.1, 0)
  2976. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
  2977. -- Credits
  2978. buttons.Credits = Instance.new("TextButton", gui)
  2979. buttons.Credits.BackgroundTransparency = 1
  2980. buttons.Credits.Name = "Credits"
  2981. buttons.Credits.TextScaled = true
  2982. buttons.Credits.TextColor3 = Color3.new(255, 255, 255)
  2983. buttons.Credits.TextStrokeColor3 = Color3.new(0, 0, 0)
  2984. buttons.Credits.TextStrokeTransparency = 0
  2985. buttons.Credits.Font = Enum.Font.ArialBold
  2986. buttons.Credits.Text = "Credits"
  2987. buttons.Credits.ZIndex = 6
  2988. buttons.Credits.Position = UDim2.new(0.4, 0, 1.7, 0)
  2989. buttons.Credits.Size = UDim2.new(0.2, 0, 0.1, 0)
  2990. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
  2991. -- FAQ
  2992. buttons.FAQ = Instance.new("TextButton", gui)
  2993. buttons.FAQ.BackgroundTransparency = 1
  2994. buttons.FAQ.Name = "FAQ"
  2995. buttons.FAQ.TextScaled = true
  2996. buttons.FAQ.TextColor3 = Color3.new(255, 255, 255)
  2997. buttons.FAQ.TextStrokeColor3 = Color3.new(0, 0, 0)
  2998. buttons.FAQ.TextStrokeTransparency = 0
  2999. buttons.FAQ.Font = Enum.Font.ArialBold
  3000. buttons.FAQ.Text = "FAQ"
  3001. buttons.FAQ.ZIndex = 6
  3002. buttons.FAQ.Position = UDim2.new(0.4, 0, 1.8, 0)
  3003. buttons.FAQ.Size = UDim2.new(0.2, 0, 0.1, 0)
  3004. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
  3005.  
  3006. buttons.Play.MouseButton1Click:connect(function()
  3007. if SButtonsDebounce then return end
  3008. SButtonsDebounce = true
  3009. run = false
  3010. Anim2Running = false
  3011. Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
  3012. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
  3013. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
  3014. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
  3015. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
  3016. wait(1)
  3017. buttons.Play:Destroy()
  3018. Img:Destroy()
  3019. SetupOThings()
  3020. end)
  3021.  
  3022. local function RunAnim()
  3023. if ReturnConf("MenuImages")[1] then
  3024. local currentimg = 1
  3025. run = true
  3026. spawn(function()
  3027. while run do
  3028. wait(0.1)
  3029. for i = 1, 5, 1 do
  3030. if not run or Img == nil then
  3031. break
  3032. end
  3033. Img:TweenSizeAndPosition(UDim2.new(0.7, 0, 0.34, 0), UDim2.new(0.15, 0, 0.13, 0), "Out", "Quad", 2, true)
  3034. wait(3)
  3035. if not run or Img == nil then
  3036. break
  3037. end
  3038. Img:TweenSizeAndPosition(UDim2.new(0.6, 0, 0.3, 0), UDim2.new(0.2, 0, 0.15, 0), "Out", "Quad", 2, true)
  3039. wait(3)
  3040. end
  3041. if Img == nil then
  3042. break
  3043. end
  3044. for i = 0, 1, 0.1 do
  3045. if not run or Img == nil then
  3046. break
  3047. end
  3048. Img.ImageTransparency = i
  3049. wait(0.1)
  3050. end
  3051. if not run or Img == nil then
  3052. break
  3053. end
  3054. if #ReturnConf("MenuImages") == currentimg then
  3055. Img.Image = ReturnConf("MenuImages")[1]
  3056. else
  3057. Img.Image = ReturnConf("MenuImages")[currentimg + 1]
  3058. end
  3059. for i = 1, 0, -0.1 do
  3060. if not run or Img == nil then
  3061. break
  3062. end
  3063. Img.ImageTransparency = i
  3064. wait(0.1)
  3065. end
  3066. end
  3067. for i = 1, 60, 1 do
  3068. if not run or Img == nil then
  3069. break
  3070. end
  3071. Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
  3072. wait()
  3073. end
  3074. end)
  3075. end
  3076. end
  3077.  
  3078. buttons.Credits.MouseButton1Click:connect(function()
  3079. if SButtonsDebounce then return end
  3080. SButtonsDebounce = true
  3081. local getusernamefromid = require(script.GetUserNameFromId)
  3082. run = false
  3083. local y = 1 / #ReturnConf("Credits")
  3084. if y > 0.3 then
  3085. y = 0.3
  3086. end
  3087. for num, i in pairs(ReturnConf("Credits")) do
  3088. local frametype = num % 2 == 1 and 1 or 2
  3089. local frame = Instance.new("Frame", script.Parent.Credits.List)
  3090. frame.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
  3091. frame.Position = UDim2.new(0, 0, (num - 1) * y, 0)
  3092. frame.Size = UDim2.new(1, 0, y, 0)
  3093. frame.Name = tostring(num)
  3094. frame.ZIndex = 9
  3095. frame.BorderColor3 = Color3.new(0,0,0)
  3096. frame.BorderSizePixel = 5
  3097. local img = Instance.new("ImageLabel", frame)
  3098. img.BackgroundTransparency = 0
  3099. img.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
  3100. img.BorderSizePixel = 3
  3101. img.BorderColor3 = Color3.new(0,0,0)
  3102. img.Size = UDim2.new(0.3, 0, 0.8, 0)
  3103. img.ZIndex = 10
  3104. img.Image = "https://www.roblox.com/bust-thumbnail/image?userId="..i["ID"].."&width=420&height=420&format=png"
  3105. local name = Instance.new("TextLabel", frame)
  3106. name.BackgroundTransparency = 1
  3107. name.TextScaled = true
  3108. name.TextColor3 = Color3.new(1,1,1)
  3109. name.Font = Enum.Font.SourceSansBold
  3110. name.Text = "Loading username..." spawn(function() name.Text = getusernamefromid(tonumber(i["ID"])) end)
  3111. name.Size = UDim2.new(0.65, 0, 0.2, 0)
  3112. name.ZIndex = 10
  3113. local rank = Instance.new("TextLabel", frame)
  3114. rank.BackgroundTransparency = 1
  3115. rank.TextScaled = true
  3116. rank.TextColor3 = Color3.new(1,1,1)
  3117. rank.Font = Enum.Font.Arcade
  3118. rank.Text = i["Rank"]
  3119. rank.Size = UDim2.new(0.65, 0, 0.2, 0)
  3120. rank.ZIndex = 10
  3121. local title = Instance.new("TextLabel", frame)
  3122. title.BackgroundTransparency = 1
  3123. title.TextScaled = true
  3124. title.TextColor3 = Color3.new(1,1,1)
  3125. title.Font = Enum.Font.Arcade
  3126. title.Text = i["Title"]
  3127. title.Size = UDim2.new(0.65, 0, 0.2, 0)
  3128. title.ZIndex = 10
  3129. if frametype == 1 then
  3130. name.TextXAlignment = "Left"
  3131. rank.TextXAlignment = "Left"
  3132. title.TextXAlignment = "Left"
  3133. img.Position = UDim2.new(0, 0, 0.1, 0)
  3134. rank.Position = UDim2.new(0.35, 0, 0, 0)
  3135. name.Position = UDim2.new(0.35, 0, 0.2, 0)
  3136. title.Position = UDim2.new(0.35, 0, 0.7, 0)
  3137. elseif frametype == 2 then
  3138. name.TextXAlignment = "Right"
  3139. rank.TextXAlignment = "Right"
  3140. title.TextXAlignment = "Right"
  3141. img.Position = UDim2.new(0.7, 0, 0.1, 0)
  3142. rank.Position = UDim2.new(0, 0, 0, 0)
  3143. name.Position = UDim2.new(0, 0, 0.2, 0)
  3144. title.Position = UDim2.new(0, 0, 0.7, 0)
  3145. end
  3146. if 0.4 * num < 0.8 then
  3147. script.Parent.Credits.List.CanvasSize = UDim2.new(0, 0, 0, 0)
  3148. else
  3149. script.Parent.Credits.List.CanvasSize = UDim2.new(0, 0, 0.4 * num, 0)
  3150. end
  3151. end
  3152. Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
  3153. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
  3154. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
  3155. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
  3156. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
  3157. wait(0.5)
  3158. script.Parent.Credits:TweenPosition(UDim2.new(0.2, 0, 0.05, 0), "Out", "Quad", 1, true)
  3159. end)
  3160. script.Parent.Credits.Back.MouseButton1Click:connect(function()
  3161. SButtonsDebounce = false
  3162. script.Parent.Credits:TweenPosition(UDim2.new(0.2, 0, 1.5, 0), "Out", "Quad", 1, true)
  3163. wait(0.5)
  3164. for _, i in pairs(script.Parent.Credits.List:GetChildren()) do i:Destroy() end
  3165. Img:TweenSizeAndPosition(UDim2.new(0.6, 0, 0.3, 0), UDim2.new(0.2, 0, 0.15, 0), "Out", "Quad", 1, true, function() run = true RunAnim() end)
  3166.  
  3167. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
  3168. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
  3169. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
  3170. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
  3171. end)
  3172. buttons.Settings.MouseButton1Click:connect(function()
  3173. if SButtonsDebounce then return end
  3174. SButtonsDebounce = true
  3175. run = false
  3176. local y = 1 / #ReturnConf("Settings")
  3177. if y > 0.15 then
  3178. y = 0.15
  3179. end
  3180. for num, i in pairs(ReturnConf("Settings")) do
  3181. local holder = Instance.new("Frame", script.Parent.Settings.List)
  3182. holder.BackgroundTransparency = 1
  3183. holder.Size = UDim2.new(1, 0, y, 0)
  3184. holder.Position = UDim2.new(0, 0, (num - 1) * y, 0)
  3185. holder.ZIndex = 8
  3186. local textlabel = Instance.new("TextLabel", holder)
  3187. textlabel.BackgroundTransparency = 1
  3188. textlabel.Size = UDim2.new(0.7, 0, 1, 0)
  3189. textlabel.Position = UDim2.new(0,0,0,0)
  3190. textlabel.TextScaled = true
  3191. textlabel.Text = i["Name"]
  3192. textlabel.ZIndex = 9
  3193. textlabel.TextColor3 = Color3.new(1,1,1)
  3194. local cur = Stats.GetStat(i["Stat"])
  3195. local textbutton = Instance.new("TextButton", holder)
  3196. textbutton.BackgroundTransparency = 1
  3197. textbutton.Size = UDim2.new(0.3, 0, 1, 0)
  3198. textbutton.Position = UDim2.new(0.7, 0, 0, 0)
  3199. textbutton.TextScaled = true
  3200. textbutton.Text = cur == 1 and "Enabled" or "Disabled"
  3201. textbutton.ZIndex = 9
  3202. textbutton.TextColor3 = cur == 1 and Color3.new(93/255, 204/255, 54/255) or Color3.new(1, 99/255, 93/255)
  3203. textbutton.MouseButton1Click:connect(function()
  3204. cur = 1 - cur
  3205. CallServer("ChangeStat", i["Stat"], cur)
  3206. textbutton.Text = cur == 1 and "Enabled" or "Disabled"
  3207. textbutton.TextColor3 = cur == 1 and Color3.new(93/255, 204/255, 54/255) or Color3.new(1, 99/255, 93/255)
  3208. end)
  3209.  
  3210. if 0.2 * num < 0.59 then
  3211. script.Parent.Settings.List.CanvasSize = UDim2.new(0, 0, 0, 0)
  3212. else
  3213. script.Parent.Settings.List.CanvasSize = UDim2.new(0, 0, 0.2 * num, 0)
  3214. end
  3215. end
  3216. Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
  3217. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
  3218. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
  3219. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
  3220. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
  3221. wait(0.5)
  3222. script.Parent.Settings:TweenPosition(UDim2.new(0.2, 0, 0.05, 0), "Out", "Quad", 1, true)
  3223. end)
  3224. script.Parent.Settings.Back.MouseButton1Click:connect(function()
  3225. SButtonsDebounce = false
  3226. script.Parent.Settings:TweenPosition(UDim2.new(0.2, 0, 1.5, 0), "Out", "Quad", 1, true)
  3227. wait(0.5)
  3228. for _, i in pairs(script.Parent.Settings.List:GetChildren()) do i:Destroy() end
  3229. Img:TweenSizeAndPosition(UDim2.new(0.6, 0, 0.3, 0), UDim2.new(0.2, 0, 0.15, 0), "Out", "Quad", 1, true, function() run = true RunAnim() end)
  3230. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
  3231. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
  3232. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
  3233. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
  3234. end)
  3235. script.Parent.Settings.Feedback.Send.MouseButton1Click:connect(function()
  3236. if script.Parent.Settings.Feedback.TextBox.Text ~= "Feedback has been sent!" then
  3237. CallServer("SendFeedback", script.Parent.Settings.Feedback.TextBox.Text)
  3238. script.Parent.Settings.Feedback.TextBox.Text = "Feedback has been sent!"
  3239. end
  3240. end)
  3241. buttons.FAQ.MouseButton1Click:connect(function()
  3242. if SButtonsDebounce then return end
  3243. SButtonsDebounce = true
  3244. run = false
  3245. local y = 1 / #ReturnConf("FAQ")
  3246. if y > 0.1 then
  3247. y = 0.1
  3248. end
  3249. for num, i in pairs(ReturnConf("FAQ")) do
  3250. local holder = Instance.new("Frame", script.Parent.FAQ.List)
  3251. holder.BackgroundTransparency = 1
  3252. holder.Size = UDim2.new(1, 0, y - 0.015, 0)
  3253. holder.Position = UDim2.new(0, 0, (num - 1) * y, 0)
  3254. holder.ZIndex = 8
  3255. local textlabel = Instance.new("TextLabel", holder)
  3256. textlabel.BackgroundTransparency = 1
  3257. textlabel.Size = UDim2.new(1, 0, 0.5, 0)
  3258. textlabel.Position = UDim2.new(0,0,0,0)
  3259. textlabel.TextScaled = true
  3260. textlabel.Text = "Question No. "..tostring(num)..": "..i["Question"]
  3261. textlabel.ZIndex = 9
  3262. textlabel.TextColor3 = Color3.new(1,1,1)
  3263. local textlabel = Instance.new("TextLabel", holder)
  3264. textlabel.BackgroundTransparency = 1
  3265. textlabel.Size = UDim2.new(1, 0, 0.5, 0)
  3266. textlabel.Position = UDim2.new(0,0,0.5,0)
  3267. textlabel.TextScaled = true
  3268. textlabel.Text = "Answer: "..i["Answer"]
  3269. textlabel.ZIndex = 9
  3270. textlabel.TextColor3 = Color3.new(1,1,1)
  3271. if 0.2 * num < 0.59 then
  3272. script.Parent.FAQ.List.CanvasSize = UDim2.new(0, 0, 0, 0)
  3273. else
  3274. script.Parent.FAQ.List.CanvasSize = UDim2.new(0, 0, 0.2 * num, 0)
  3275. end
  3276. end
  3277. Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
  3278. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
  3279. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
  3280. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
  3281. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
  3282. wait(0.5)
  3283. script.Parent.FAQ:TweenPosition(UDim2.new(0.1, 0, 0.05, 0), "Out", "Quad", 1, true)
  3284. end)
  3285. script.Parent.FAQ.Back.MouseButton1Click:connect(function()
  3286. SButtonsDebounce = false
  3287. script.Parent.FAQ:TweenPosition(UDim2.new(0.1, 0, 1.5, 0), "Out", "Quad", 1, true)
  3288. wait(0.5)
  3289. for _, i in pairs(script.Parent.FAQ.List:GetChildren()) do i:Destroy() end
  3290. Img:TweenSizeAndPosition(UDim2.new(0.6, 0, 0.3, 0), UDim2.new(0.2, 0, 0.15, 0), "Out", "Quad", 1, true, function() run = true RunAnim() end)
  3291. buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
  3292. buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
  3293. buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
  3294. buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
  3295. end)
  3296.  
  3297.  
  3298. wait(1)
  3299.  
  3300. RunAnim()
  3301.  
  3302. end
  3303.  
  3304. SetupSGui()
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement