Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Configuration = require(script:WaitForChild("Config"))
- local Stats = require(game:GetService("Players").LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("Stats"))
- function ReturnConf(CNAME)
- if Configuration[CNAME] ~= nil then
- return Configuration[CNAME]
- end
- end
- game.ReplicatedFirst:RemoveDefaultLoadingScreen()
- local function wait(waittime)
- local waittime = waittime
- if waittime == nil then
- waittime = 0.01
- end
- local starttime = tick()
- repeat game:GetService("RunService").Stepped:wait() until tick() >= starttime+waittime
- end
- --game:GetService("GuiService").AutoSelectGuiEnabled = false
- --game:GetService("GuiService").GuiNavigationEnabled = false
- --game:GetService("GuiService").CoreGuiNavigationEnabled = false
- game:GetService("UserInputService").ModalEnabled = true
- local mobileinterface = game:GetService("UserInputService").TouchEnabled
- script.Parent.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local PokemonDatas
- local gui = script.Parent
- local IntroShown = _G.IntroShown
- script:WaitForChild("Pokemon")
- local mods = require(script:WaitForChild("Encoder"))
- local mod = mods["GetFromCode"]
- local mod2 = mods["GetOR"]
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
- local inf = gui.Intro
- local event = game.ReplicatedStorage.FUNCTION
- function CallServer(...)
- return event:InvokeServer(...)
- end
- --[[
- local LogService = game:GetService("LogService")
- LogService.MessageOut:connect(function(Msg, Type)
- CallServer("ReportIssue", Type, Msg)
- end)
- ]]
- CallServer("IsBanned")
- local Anim2Running = true
- local function GetDayState()
- local Minutes = game:GetService("Lighting"):GetMinutesAfterMidnight()
- if Minutes >= 0 and Minutes < 3 * 60 then
- return "Night"
- elseif Minutes >= 3 * 60 and Minutes < 6 * 60 then
- return "Late Night"
- elseif Minutes >= 6 * 60 and Minutes < 9 * 60 then
- return "Morning"
- elseif Minutes >= 9 * 60 and Minutes < 12 * 60 then
- return "Late Morning"
- elseif Minutes >= 12 * 60 and Minutes < 15 * 60 then
- return "Afternoon"
- elseif Minutes >= 15 * 60 and Minutes < 18 * 60 then
- return "Late Afternoon"
- elseif Minutes >= 18 * 60 and Minutes < 21 * 60 then
- return "Evening"
- elseif Minutes >= 21 * 60 and Minutes < 24 * 60 then
- return "Late Evening"
- end
- end
- local function RunAnim2()
- spawn(function()
- while Anim2Running do
- for _, i in pairs(script.Parent.Intro.AnimFrame:GetChildren()) do
- local CurrentState = GetDayState()
- if i.Image ~= ReturnConf("BackgroundImage")[CurrentState] then
- i.Image = ReturnConf("BackgroundImage")[CurrentState]
- end
- i.Position = i.Position - UDim2.new(0.0025, 0, 0, 0)
- if i.Position.X.Scale <= -0.99 then
- i.Position = UDim2.new(1, 0, 0, 0)
- end
- end
- game:GetService("RunService").RenderStepped:wait()
- end
- end)
- end
- RunAnim2()
- if not IntroShown then
- local loading = true
- inf.Visible = true
- wait(1)
- inf.Logo:TweenPosition(UDim2.new(0.18, 0, 0.55, 0), "Out", "Quad", 1, true)
- inf.Text:TweenPosition(UDim2.new(0.1, 0, 0.8, 0), "Out", "Quad", 1, true)
- inf.Loading:TweenPosition(UDim2.new(0.5, -25, 0.9, -25), "Out", "Quad", 1, true)
- spawn(function()
- while loading do
- inf.Loading.Rotation = inf.Loading.Rotation + 30
- wait(0.075)
- end
- end)
- local rate = 0
- spawn(function() -- Status
- inf.Text.Text = "Loading assets..."
- wait(1)
- while rate ~= 100 do
- if rate > 0 then
- inf.Text.Text = math.floor(tostring(rate)).."%"
- else
- inf.Text.Text = "0%"
- end
- wait()
- end
- inf.Text.Text = tostring(rate).."%"
- end)
- local assets = {}
- function Scan(location)
- for _, i in pairs(location:GetChildren()) do
- if i:IsA'ImageLabel' then
- table.insert(assets, i.Image)
- elseif i:IsA'ImageButton' then
- table.insert(assets, i.Image)
- elseif i:IsA'Tool' then
- table.insert(assets, i.TextureId)
- elseif i:IsA'Animation' then
- table.insert(assets, i.AnimationId)
- elseif i:IsA'Sound' then
- table.insert(assets, i.SoundId)
- elseif i.Name == "ImageId" then
- table.insert(assets, i.Value)
- end
- Scan(i)
- end
- end
- Scan(game.Players.LocalPlayer)
- local assets_c = #assets
- local assets_l = 0
- for _, i in pairs(assets) do
- if string.sub(i, 1, 13) == "rbxassetid://" then
- game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..string.sub(i, 14))
- elseif string.sub(i, 1, 32) == "http://www.roblox.com/asset/?id=" then
- game:GetService("ContentProvider"):Preload(i)
- elseif string.sub(i, 1, 11) == "rbxasset://" then
- game:GetService("ContentProvider"):Preload(i)
- elseif i ~= "" then
- game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..i)
- end
- end
- while (game:GetService("ContentProvider").RequestQueueSize > 0) do
- assets_l = assets_c - game:GetService("ContentProvider").RequestQueueSize
- local dot = string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 > 0 and string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 or 3
- rate = tonumber(string.sub(tostring(( assets_l / assets_c ) * 100), 1, dot))
- wait()
- end
- assets_l = assets_c - game:GetService("ContentProvider").RequestQueueSize
- local dot = string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 > 0 and string.find(tostring(( assets_l / assets_c) * 100), ".") - 1 or 3
- rate = tonumber(string.sub(tostring(( assets_l / assets_c ) * 100), 1, dot))
- loading = false
- wait(0.5)
- inf.Loading:TweenPosition(UDim2.new(0.5, -25, 1.17, -25), "Out", "Quad", 1, true)
- inf.Logo:TweenPosition(UDim2.new(0.18, 0, 0.15, 0), "Out", "Quad", 1, true)
- inf.Text:TweenPosition(UDim2.new(0.1, 0, 1.07, 0), "Out", "Quad", 1, true)
- wait(1)
- _G.IntroShown = true
- end
- inf.Loading:Destroy()
- inf.Logo:Destroy()
- inf.Text:Destroy()
- wait(1)
- function SetupHUD(cc, cp)
- wait(0.05)
- game.Players.LocalPlayer.Character:WaitForChild("WaterGravity").Disabled = false
- -- ACCEPTATION SERVICE
- local OnAcceptation = nil
- local accfuncid = 0
- local function CheckAcceptionSupport()
- return (CallServer("GetStat", "ChatAcceptations") == 1)
- end
- local function AddOnAcception(func, notification)
- OnAcceptation = func
- CallServer("SENDACCEPTATION", notification)
- accfuncid = accfuncid + 1
- return accfuncid
- end
- local function ResetOnAcceptation()
- OnAcceptation = nil
- accfuncid = accfuncid + 1
- end
- local function OnAccepted(state)
- if OnAcceptation then
- return OnAcceptation(state)
- end
- return "There arent any action to accept!"
- end
- if not mobileinterface then
- script.Parent.InfoBar.Size = UDim2.new(0.2, 0, 0.15, 0)
- script.Parent.HideBar.Size = UDim2.new(0.161, 0, 0.15, 0)
- script.Parent.Expand.Size = UDim2.new(0.06, 0, 0.15, 0)
- script.Parent.InfoBar.Position = UDim2.new(0, 0, -0.5, 0)
- script.Parent.HideBar.Position = UDim2.new(0.04, 0, -0.5, 0)
- script.Parent.Expand.Position = UDim2.new(0.18, 0, -0.5, 0)
- end
- local openedframe = ""
- local FirstShopSettings = {}
- local Settings = {"BorderColor3", "BorderSizePixel", "BackgroundColor3", "BackgroundTransparency", "TextColor3", "TextTransparency", "TextStrokeColor3", "TextStrokeTransparency"}
- local function Shop_AddToList(thing)
- for _, i in pairs(Settings) do
- local canapply = true
- if string.sub(i, 1, 4) == "Text" then
- if string.sub(thing.ClassName, 1, 4) ~= "Text" then
- canapply = false
- end
- end
- if canapply then
- local name = nil
- if type(thing[i]) == "userdata" then
- name = tostring(thing[i].r)..";"..tostring(thing[i].g)..";"..tostring(thing[i].b)
- else
- name = thing[i]
- end
- if FirstShopSettings[i] == nil then FirstShopSettings[i] = {} end
- if FirstShopSettings[i][name] == nil then FirstShopSettings[i][name] = {} end
- table.insert(FirstShopSettings[i][name], thing)
- end
- end
- end
- local function Shop_LoadOrgSettings()
- for setting, v in pairs(FirstShopSettings) do
- for value, v2 in pairs(v) do
- for _, part in pairs(v2) do
- local r, g, b = string.match(value, "(.+);(.+);(.+)")
- if r ~= nil and g ~= nil and b ~= nil then
- part[setting] = Color3.new(tonumber(r), tonumber(g), tonumber(b))
- else
- part[setting] = value
- end
- end
- end
- end
- end
- for _, i in pairs(script.Parent.Shop:GetChildren()) do
- Shop_AddToList(i)
- end
- Shop_AddToList(script.Parent.Shop)
- script.Parent.Shop.Exit.MouseButton1Click:connect(function()
- script.Parent.Shop:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- if openedframe == "SHOP" then
- if game.Players.LocalPlayer.Character then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = false
- end
- end
- openedframe = ""
- end
- end)
- function SetupShop(name)
- local data = script.Shops:FindFirstChild(name)
- local shopframe = script.Parent.Shop
- if data then
- for _, i in pairs(shopframe.Things:GetChildren()) do
- i:Destroy()
- end
- shopframe.Image.Image = "rbxassetid://"..tostring(data.Image.Value)
- shopframe.Quote.Text = data.Quote.Value
- shopframe.SName.Text = data.SName.Value
- local categories = {}
- for _, i in pairs(data:GetChildren()) do
- if i:IsA'Folder' then
- table.insert(categories, i)
- end
- end
- if #categories ~= 0 then
- local x = 1 / #categories
- for a, i in pairs(categories) do
- local TB = Instance.new("TextLabel", shopframe.Things)
- TB.Text = i.Name
- TB.Name = i.Name
- TB.BackgroundTransparency = 1
- TB.Size = UDim2.new(x, 0, 0.1, 0)
- TB.Position = UDim2.new(x * (a - 1), 0, 0, 0)
- TB.Font = Enum.Font.ArialBold
- TB.TextScaled = true
- TB.TextColor3 = Color3.new(1,1,1)
- local CG = Instance.new("ScrollingFrame", shopframe.Things)
- CG.BackgroundTransparency = 1
- CG.Name = i.Name
- CG.Position = UDim2.new(x * (a - 1), 0, 0.1, 0)
- CG.Size = UDim2.new(x, 0, 0.9, 0)
- CG.BorderSizePixel = 0
- -- BUTTON CREATION
- local y = 1 / #i:GetChildren()
- if #i:GetChildren() <= 5 then
- y = 0.2
- end
- for num, but in pairs(i:GetChildren()) do
- local B = Instance.new("TextButton", CG)
- B.Text = "Loading"
- B.Name = but.Name
- B.Position = UDim2.new(0.15, 0, y * (num - 1) + (y / 4), 0)
- B.Size = UDim2.new(0.7, 0, y - (y / 4), 0)
- B.BorderColor3 = Color3.new(0, 0, 0)
- B.BorderSizePixel = 2
- B.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
- B.TextColor3 = Color3.new(1,1,1)
- B.TextScaled = true
- B.Font = Enum.Font.Arial
- -- SETUPPING
- require(but)(B, game.Players.LocalPlayer, CallServer)
- if 0.2 * num + 0.05 < 1 then
- CG.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- CG.CanvasSize = UDim2.new(0, 0, (0.15 * num) + 0.05, 0)
- end
- end
- end
- end
- -- LOADING CUSTOMIZING SCRIPT
- Shop_LoadOrgSettings()
- if data:FindFirstChild("CustomizingScript") then
- local function SetSetting(part, setting, newvalue)
- local canapply = true
- if string.sub(setting, 1, 4) == "Text" then
- if string.sub(part.ClassName, 1, 4) ~= "Text" then
- canapply = false
- end
- end
- if canapply then
- part[setting] = newvalue
- end
- end
- local configuration = require(data["CustomizingScript"])
- if configuration["BorderColor"] then
- SetSetting(shopframe, "BorderColor3", configuration["BorderColor"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BorderColor3", configuration["BorderColor"])
- end
- end
- SetSetting(i, "BorderColor3", configuration["BorderColor"])
- end
- end
- if configuration["BorderSize"] then
- SetSetting(shopframe, "BorderSizePixel", configuration["BorderSize"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BorderSizePixel", configuration["BorderSize"])
- end
- end
- SetSetting(i, "BorderSizePixel", configuration["BorderSize"])
- end
- end
- if configuration["BackgroundColor"] then
- SetSetting(shopframe, "BackgroundColor3", configuration["BackgroundColor"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BackgroundColor3", configuration["BackgroundColor"])
- end
- end
- SetSetting(i, "BackgroundColor3", configuration["BackgroundColor"])
- end
- end
- if configuration["BackgroundTransparency"] then
- SetSetting(shopframe, "BackgroundTransparency", configuration["BackgroundTransparency"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BackgroundTransparency", configuration["BackgroundTransparency"])
- end
- end
- SetSetting(i, "BackgroundTransparency", configuration["BackgroundTransparency"])
- end
- end
- if configuration["TextColor"] then
- SetSetting(shopframe, "TextColor3", configuration["TextColor"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextColor3", configuration["TextColor"])
- end
- end
- SetSetting(i, "TextColor3", configuration["TextColor"])
- end
- end
- if configuration["TextTransparency"] then
- SetSetting(shopframe, "TextTransparency", configuration["TextTransparency"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextTransparency", configuration["TextTransparency"])
- end
- end
- SetSetting(i, "TextTransparency", configuration["TextTransparency"])
- end
- end
- if configuration["TextStrokeColor"] then
- SetSetting(shopframe, "TextStrokeColor3", configuration["TextStrokeColor"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextStrokeColor3", configuration["TextStrokeColor"])
- end
- end
- SetSetting(i, "TextStrokeColor3", configuration["TextStrokeColor"])
- end
- end
- if configuration["TextStrokeTransparency"] then
- SetSetting(shopframe, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
- for _, i in pairs(shopframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
- end
- end
- SetSetting(i, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
- end
- end
- end
- return true
- end
- return false
- end
- local FirstQuestsSettings = {}
- local Settings = {"BorderColor3", "BorderSizePixel", "BackgroundColor3", "BackgroundTransparency", "TextColor3", "TextTransparency", "TextStrokeColor3", "TextStrokeTransparency"}
- local function Quests_AddToList(thing)
- for _, i in pairs(Settings) do
- local canapply = true
- if string.sub(i, 1, 4) == "Text" then
- if string.sub(thing.ClassName, 1, 4) ~= "Text" then
- canapply = false
- end
- end
- if canapply then
- local name = nil
- if type(thing[i]) == "userdata" then
- name = tostring(thing[i].r)..";"..tostring(thing[i].g)..";"..tostring(thing[i].b)
- else
- name = thing[i]
- end
- if FirstQuestsSettings[i] == nil then FirstQuestsSettings[i] = {} end
- if FirstQuestsSettings[i][name] == nil then FirstQuestsSettings[i][name] = {} end
- table.insert(FirstQuestsSettings[i][name], thing)
- end
- end
- end
- local function Quests_LoadOrgSettings()
- for setting, v in pairs(FirstQuestsSettings) do
- for value, v2 in pairs(v) do
- for _, part in pairs(v2) do
- local r, g, b = string.match(value, "(.+);(.+);(.+)")
- if r ~= nil and g ~= nil and b ~= nil then
- part[setting] = Color3.new(tonumber(r), tonumber(g), tonumber(b))
- else
- part[setting] = value
- end
- end
- end
- end
- end
- for _, i in pairs(script.Parent.Shop:GetChildren()) do
- Quests_AddToList(i)
- end
- Quests_AddToList(script.Parent.Quests)
- script.Parent.Quests.Exit.MouseButton1Click:connect(function()
- script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- if openedframe == "QUESTS" then
- if game.Players.LocalPlayer.Character then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = false
- end
- end
- openedframe = ""
- end
- end)
- function SetupQuest(name)
- local data = script.Quests:FindFirstChild(name)
- local questframe = script.Parent.Quests
- if data then
- for _, i in pairs(questframe.Things.Quests.Quests:GetChildren()) do
- i:Destroy()
- end
- for _, i in pairs(questframe.Things.Milestones.Milestones:GetChildren()) do
- i:Destroy()
- end
- local buttontextcolor = Color3.new(1,1,1)
- local buttonbordercolor = Color3.new(0,0,0)
- local buttonbackgroundcolor = Color3.new(61/255, 61/255, 61/255)
- questframe.Things.Informations.Finish.Visible = false
- questframe.Things.Informations.Finish.Text = "Finish quest!"
- if data:FindFirstChild("CustomizingScript") then
- local configuration = require(data["CustomizingScript"])
- if configuration["ButtonTextColor"] then buttontextcolor = configuration["ButtonTextColor"] end
- if configuration["ButtonBorderColor"] then buttonbordercolor = configuration["ButtonBorderColor"] end
- if configuration["ButtonBackgroundColor"] then buttonbackgroundcolor = configuration["ButtonBackgroundColor"] end
- if configuration["FinishTextColor"] then questframe.Things.Informations.Finish.TextColor3 = configuration["FinishTextColor"] end
- if configuration["FinishBorderColor"] then questframe.Things.Informations.Finish.BorderColor3 = configuration["FinishBorderColor"] end
- if configuration["FinishBackgroundColor"] then questframe.Things.Informations.Finish.BackgroundColor3 = configuration["FinishBackgroundColor"] end
- else
- questframe.Things.Informations.Finish.TextColor3 = buttontextcolor
- questframe.Things.Informations.Finish.BorderColor3 = buttonbordercolor
- questframe.Things.Informations.Finish.BackgroundColor3 = buttonbackgroundcolor
- end
- questframe.Things.Informations.Awards.Text = "Awards:"
- questframe.Things.Informations.QuestDescription.Text = "Quest Description:"
- questframe.Things.Informations.QuestName.Text = "Quest Name:"
- questframe.Things.Informations.RequiredItems.Text = "Required Items:"
- questframe.Image.Image = "rbxassetid://"..tostring(data.Image.Value)
- questframe.Quote.Text = data.Quote.Value
- questframe.SName.Text = data.SName.Value
- local C_Quest_ID = nil
- local function SetupInformations(controller)
- local finished = controller.GetFinishedState()
- local informations = controller.GetInformations()
- questframe.Things.Informations.Finish.Visible = not finished
- questframe.Things.Informations.Finish.Text = "Finish quest!"
- questframe.Things.Informations.Awards.Text = "Awards: "..informations.Awards
- questframe.Things.Informations.QuestDescription.Text = "Quest Description: "..informations.Desc
- questframe.Things.Informations.QuestName.Text = "Quest Name: "..informations.Name
- questframe.Things.Informations.RequiredItems.Text = "Required Items: "..informations.RequiredItems
- end
- questframe.Things.Informations.Finish.MouseButton1Click:connect(function()
- if not C_Quest_ID then return end
- if not data.Quests:FindFirstChild(C_Quest_ID) then return end
- local mod = require(data.Quests[C_Quest_ID])
- local suc, msg = mod(CallServer, mods).FinishClicked()
- local C_ID = C_Quest_ID
- questframe.Things.Informations.Finish.Text = msg
- if suc then
- questframe.Things.Quests.Quests[C_Quest_ID].Finished.Text = "FINISHED!"
- questframe.Things.Quests.Quests[C_Quest_ID].Finished.TextColor3 = Color3.new(0, 175/255, 0)
- end
- wait(5)
- if not (C_Quest_ID == C_ID) then return end
- if suc then questframe.Things.Informations.Finish.Visible = false end
- questframe.Things.Informations.Finish.Text = "Finish quest!"
- end)
- local function GetDoneQuests()
- local num = 0
- for _, i in pairs(data.Quests:GetChildren()) do
- local QuestData = require(i)(CallServer, mods)
- if QuestData.GetFinishedState() and QuestData.CountedToMilestone then
- num = num + 1
- end
- end
- return num
- end
- local y = 1 / #data.Quests:GetChildren()
- if #data.Quests:GetChildren() <= 5 then
- y = 0.2
- end
- for num, but in pairs(data.Quests:GetChildren()) do
- local B = Instance.new("Frame", questframe.Things.Quests.Quests)
- B.Name = but.Name
- B.Position = UDim2.new(0.15, 0, y * (num - 1) + (y / 4), 0)
- B.Size = UDim2.new(0.7, 0, y - (y / 4), 0)
- B.BackgroundColor3 = buttonbackgroundcolor
- B.BorderColor3 = buttonbordercolor
- B.BorderSizePixel = 1
- local HB = Instance.new("TextButton", B)
- HB.Name = "Hitbox"
- HB.Text = ""
- HB.BackgroundTransparency = 1
- HB.Position = UDim2.new(0,0,0,0)
- HB.Size = UDim2.new(1,0,1,0)
- HB.ZIndex = 5
- local N = Instance.new("TextLabel", B)
- N.Name = "Number"
- N.Position = UDim2.new(0,0,0,0)
- N.Size = UDim2.new(1, 0, 0.65, 0)
- N.Font = Enum.Font.ArialBold
- N.Text = "Quest #"..but.Name
- N.TextColor3 = buttontextcolor
- N.TextScaled = true
- N.TextXAlignment = Enum.TextXAlignment.Left
- N.TextYAlignment = Enum.TextYAlignment.Top
- N.BackgroundTransparency = 1
- local F = Instance.new("TextLabel", B)
- F.Name = "Finished"
- F.Position = UDim2.new(0,0,0.65,0)
- F.Size = UDim2.new(1, 0, 0.35, 0)
- F.Font = Enum.Font.ArialBold
- F.Text = "NOT FINISHED!"
- F.BackgroundTransparency = 1
- F.TextColor3 = Color3.new(175/255, 0, 0)
- F.TextScaled = true
- F.TextXAlignment = Enum.TextXAlignment.Left
- F.TextYAlignment = Enum.TextYAlignment.Top
- -- SETUPPING
- local controller = require(but)(CallServer, mods)
- if controller.GetFinishedState() then F.Text = "FINISHED!" F.TextColor3 = Color3.new(0, 175/255, 0) end
- HB.MouseButton1Click:connect(function()
- C_Quest_ID = but.Name
- SetupInformations(controller)
- end)
- if 0.2 * num + 0.05 < 1 then
- questframe.Things.Quests.Quests.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- questframe.Things.Quests.Quests.CanvasSize = UDim2.new(0, 0, (0.15 * num) + 0.05, 0)
- end
- end
- local y = 1 / #data.Milestones:GetChildren()
- if #data.Milestones:GetChildren() <= 5 then
- y = 0.2
- end
- for num, but in pairs(data.Milestones:GetChildren()) do
- local controller = require(but)(CallServer, mods)
- local B = Instance.new("Frame", questframe.Things.Milestones.Milestones)
- B.Name = but.Name
- B.Position = UDim2.new(0.15, 0, y * (num - 1) + (y / 4), 0)
- B.Size = UDim2.new(0.7, 0, y - (y / 4), 0)
- B.BackgroundColor3 = buttonbackgroundcolor
- B.BorderColor3 = buttonbordercolor
- B.BorderSizePixel = 1
- local HB = Instance.new("TextButton", B)
- HB.Name = "Hitbox"
- HB.Text = ""
- HB.BackgroundTransparency = 1
- HB.Position = UDim2.new(0,0,0,0)
- HB.Size = UDim2.new(1,0,1,0)
- HB.ZIndex = 5
- local N = Instance.new("TextLabel", B)
- N.Name = "Number"
- N.Position = UDim2.new(0,0,0,0)
- N.BackgroundTransparency = 1
- N.Size = UDim2.new(1, 0, 0.65, 0)
- N.Font = Enum.Font.ArialBold
- N.Text = "Milestone #"..but.Name.." ("..controller.GetInformations().QuestsNeeded.." Quests)"
- N.TextColor3 = buttontextcolor
- N.TextScaled = true
- N.TextXAlignment = Enum.TextXAlignment.Left
- N.TextYAlignment = Enum.TextYAlignment.Top
- local F = Instance.new("TextLabel", B)
- F.Name = "Finished"
- F.BackgroundTransparency = 1
- F.Position = UDim2.new(0,0,0.65,0)
- F.Size = UDim2.new(1, 0, 0.35, 0)
- F.Font = Enum.Font.ArialBold
- F.Text = controller.GetFinishedState() and "FINISHED!" or controller.GetInformations().Awards
- F.TextColor3 = controller.GetFinishedState() and Color3.new(0, 175/255, 0) or buttontextcolor
- F.TextScaled = true
- F.TextXAlignment = Enum.TextXAlignment.Left
- F.TextYAlignment = Enum.TextYAlignment.Top
- HB.MouseButton1Click:connect(function()
- if GetDoneQuests() >= controller.GetInformations().QuestsNeeded then
- if controller.FinishClicked() then
- F.Text = "FINISHED!"
- F.TextColor3 = Color3.new(0, 175/255, 0)
- end
- end
- end)
- -- SETUPPING
- if 0.2 * num + 0.05 < 1 then
- questframe.Things.Milestones.Milestones.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- questframe.Things.Milestones.Milestones.CanvasSize = UDim2.new(0, 0, (0.15 * num) + 0.05, 0)
- end
- end
- -- LOADING CUSTOMIZING SCRIPT
- Quests_LoadOrgSettings()
- if data:FindFirstChild("CustomizingScript") then
- local function SetSetting(part, setting, newvalue)
- local canapply = true
- if string.sub(setting, 1, 4) == "Text" then
- if string.sub(part.ClassName, 1, 4) ~= "Text" then
- canapply = false
- end
- end
- if canapply then
- part[setting] = newvalue
- end
- end
- local configuration = require(data["CustomizingScript"])
- if configuration["BorderColor"] then
- SetSetting(questframe, "BorderColor3", configuration["BorderColor"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BorderColor3", configuration["BorderColor"])
- end
- end
- SetSetting(i, "BorderColor3", configuration["BorderColor"])
- end
- end
- if configuration["BorderSize"] then
- SetSetting(questframe, "BorderSizePixel", configuration["BorderSize"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BorderSizePixel", configuration["BorderSize"])
- end
- end
- SetSetting(i, "BorderSizePixel", configuration["BorderSize"])
- end
- end
- if configuration["BackgroundColor"] then
- SetSetting(questframe, "BackgroundColor3", configuration["BackgroundColor"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BackgroundColor3", configuration["BackgroundColor"])
- end
- end
- SetSetting(i, "BackgroundColor3", configuration["BackgroundColor"])
- end
- end
- if configuration["BackgroundTransparency"] then
- SetSetting(questframe, "BackgroundTransparency", configuration["BackgroundTransparency"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "BackgroundTransparency", configuration["BackgroundTransparency"])
- end
- end
- SetSetting(i, "BackgroundTransparency", configuration["BackgroundTransparency"])
- end
- end
- if configuration["TextColor"] then
- SetSetting(questframe, "TextColor3", configuration["TextColor"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextColor3", configuration["TextColor"])
- end
- end
- SetSetting(i, "TextColor3", configuration["TextColor"])
- end
- end
- if configuration["TextTransparency"] then
- SetSetting(questframe, "TextTransparency", configuration["TextTransparency"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextTransparency", configuration["TextTransparency"])
- end
- end
- SetSetting(i, "TextTransparency", configuration["TextTransparency"])
- end
- end
- if configuration["TextStrokeColor"] then
- SetSetting(questframe, "TextStrokeColor3", configuration["TextStrokeColor"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextStrokeColor3", configuration["TextStrokeColor"])
- end
- end
- SetSetting(i, "TextStrokeColor3", configuration["TextStrokeColor"])
- end
- end
- if configuration["TextStrokeTransparency"] then
- SetSetting(questframe, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
- for _, i in pairs(questframe:GetChildren()) do
- if i:IsA'Frame' then
- for _, o in pairs(i:GetChildren()) do
- SetSetting(o, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
- end
- end
- SetSetting(i, "TextStrokeTransparency", configuration["TextStrokeTransparency"])
- end
- end
- end
- return true
- end
- return false
- end
- local ef = gui.Expand
- local hb = gui.HideBar
- local ib = gui.InfoBar
- local debounce = {["Expand"] = false}
- local prepared = nil
- local efnormal = {ef.HitBox:Clone(), ef.Special:Clone()}
- game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
- local ondeathframe = Instance.new("Frame", script.Parent)
- ondeathframe.Position = UDim2.new(0, 0, -1, 0)
- ondeathframe.Size = UDim2.new(1, 0, 2, 0)
- ondeathframe.BackgroundColor3 = Color3.new(65/255, 65/255, 65/255)
- ondeathframe.ZIndex = 9
- ondeathframe.BorderSizePixel = 0
- ondeathframe.BackgroundTransparency = 1
- local img = Instance.new("ImageLabel", ondeathframe)
- img.BackgroundTransparency = 1
- img.ImageTransparency = 1
- img.Position = UDim2.new(0, 0, 0.5, 0)
- img.Size = UDim2.new(1, 0, 0.5, 0)
- img.ZIndex = 10
- img.Image = ReturnConf("BackgroundImage")[GetDayState()]
- for i = 1, 0, -0.05 do
- ondeathframe.BackgroundTransparency = i
- img.ImageTransparency = i
- wait(1/60)
- end
- ondeathframe.BackgroundTransparency = 0
- img.ImageTransparency = 0
- end)
- if game:GetService("UserInputService").GamepadEnabled then
- prepared = "XBOX"
- if ef:FindFirstChild("HitBox") then ef.HitBox:Destroy() end
- if ef:FindFirstChild("Special") then ef.Special:Destroy() end
- local ModuleAsset = game:GetService('InsertService'):LoadAsset(408470686)
- local InputImageLibrary = require(ModuleAsset.MainModule)
- local ImageControl = InputImageLibrary:GetImageLabel(Enum.KeyCode.ButtonY, "Dark")
- ImageControl.Parent = ef
- ImageControl.Size = UDim2.new(1, 0, 1, 0)
- ImageControl.ZIndex = 6
- ImageControl.BackgroundTransparency = 1
- ImageControl.Position = UDim2.new(0.12, 0, 0, 0)
- ImageControl.Size = UDim2.new(1.87, 0, 1, 0)
- ImageControl.Name = "XBoxControlImage"
- else
- prepared = "NORMAL"
- ef.HitBox.MouseButton1Click:connect(function()
- if debounce["Expand"] == false then
- debounce["Expand"] = true
- if mobileinterface then
- ef:TweenPosition(UDim2.new(0.54, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.3, 0, 0, 0), "Out", "Quad", 1, true)
- else
- ef:TweenPosition(UDim2.new(0.34, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.2, 0,0, 0), "Out", "Quad", 1, true)
- end
- for _, i in pairs(hb:GetChildren()) do
- i.Active = true
- end
- local Showing = false -- CONFIG
- local STick = tick()
- while true do
- local Seconds = tick() - STick
- if debounce["Expand"] == not Showing then
- if Showing then
- if Seconds > 0 then
- ef.Special.Special2.BackgroundTransparency = 1 - Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 0
- break
- end
- else
- if Seconds < 1 then
- ef.Special.Special2.BackgroundTransparency = Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 1
- break
- end
- end
- else
- break
- end
- wait(1/60)
- end
- elseif debounce["Expand"] == true then
- debounce["Expand"] = false
- if mobileinterface then
- ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true)
- else
- hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true)
- ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true)
- end
- for _, i in pairs(hb:GetChildren()) do
- i.Active = false
- end
- local Showing = true -- CONFIG
- local STick = tick()
- while true do
- local Seconds = tick() - STick
- if debounce["Expand"] == not Showing then
- if Showing then
- if Seconds > 0 then
- ef.Special.Special2.BackgroundTransparency = 1 - Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 0
- break
- end
- else
- if Seconds < 1 then
- ef.Special.Special2.BackgroundTransparency = Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 1
- break
- end
- end
- else
- break
- end
- wait(1/60)
- end
- end
- end)
- end
- game:GetService("UserInputService").InputBegan:connect(function(input)
- if input.UserInputType == Enum.UserInputType.Gamepad1 then
- if input.KeyCode == Enum.KeyCode.ButtonY then
- if not game:GetService("GuiService").MenuIsOpen then
- if debounce["Expand"] == false then
- debounce["Expand"] = true
- if mobileinterface then
- ef:TweenPosition(UDim2.new(0.54, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.3, 0, 0, 0), "Out", "Quad", 1, true)
- else
- ef:TweenPosition(UDim2.new(0.34, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.2, 0,0, 0), "Out", "Quad", 1, true)
- end
- for _, i in pairs(hb:GetChildren()) do
- i.Active = true
- end
- elseif debounce["Expand"] == true then
- debounce["Expand"] = false
- if mobileinterface then
- ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true)
- else
- hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true)
- ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true)
- end
- for _, i in pairs(hb:GetChildren()) do
- i.Active = false
- end
- end
- end
- end
- end
- end)
- game:GetService("UserInputService").GamepadConnected:connect(function(gamepad)
- if gamepad == Enum.UserInputType.Gamepad1 then
- if prepared == "NORMAL" then
- prepared = "XBOX"
- if ef:FindFirstChild("HitBox") then ef.HitBox:Destroy() end
- if ef:FindFirstChild("Special") then ef.Special:Destroy() end
- local ModuleAsset = game:GetService('InsertService'):LoadAsset(408470686)
- local InputImageLibrary = require(ModuleAsset.MainModule)
- local ImageControl = InputImageLibrary:GetImageLabel(Enum.KeyCode.ButtonY, "Dark")
- ImageControl.Parent = ef
- ImageControl.Size = UDim2.new(1, 0, 1, 0)
- ImageControl.ZIndex = 6
- ImageControl.BackgroundTransparency = 1
- ImageControl.Position = UDim2.new(0.12, 0, 0, 0)
- ImageControl.Size = UDim2.new(1.87, 0, 1, 0)
- ImageControl.Name = "XBoxControlImage"
- end
- end
- end)
- game:GetService("UserInputService").GamepadDisconnected:connect(function(gamepad)
- if gamepad == Enum.UserInputType.Gamepad1 then
- if prepared == "XBOX" then
- prepared = "NORMAL"
- for _, i in pairs(efnormal) do
- i:Clone().Parent = ef
- end
- ef.HitBox.MouseButton1Click:connect(function()
- if debounce["Expand"] == false then
- debounce["Expand"] = true
- if mobileinterface then
- ef:TweenPosition(UDim2.new(0.54, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.3, 0, 0, 0), "Out", "Quad", 1, true)
- else
- ef:TweenPosition(UDim2.new(0.34, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.2, 0,0, 0), "Out", "Quad", 1, true)
- end
- for _, i in pairs(hb:GetChildren()) do
- i.Active = true
- end
- local Showing = false -- CONFIG
- local STick = tick()
- while true do
- local Seconds = tick() - STick
- if debounce["Expand"] == not Showing then
- if Showing then
- if Seconds > 0 then
- ef.Special.Special2.BackgroundTransparency = 1 - Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 0
- break
- end
- else
- if Seconds < 1 then
- ef.Special.Special2.BackgroundTransparency = Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 1
- break
- end
- end
- else
- break
- end
- wait(1/60)
- end
- elseif debounce["Expand"] == true then
- debounce["Expand"] = false
- if mobileinterface then
- ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true)
- hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true)
- else
- hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true)
- ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true)
- end
- for _, i in pairs(hb:GetChildren()) do
- i.Active = false
- end
- local Showing = true -- CONFIG
- local STick = tick()
- while true do
- local Seconds = tick() - STick
- if debounce["Expand"] == not Showing then
- if Showing then
- if Seconds > 0 then
- ef.Special.Special2.BackgroundTransparency = 1 - Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 0
- break
- end
- else
- if Seconds < 1 then
- ef.Special.Special2.BackgroundTransparency = Seconds
- else
- ef.Special.Special2.BackgroundTransparency = 1
- break
- end
- end
- else
- break
- end
- wait(1/60)
- end
- end
- end)
- end
- end
- end)
- local InTrade = false
- -- INVENTORY
- local UseTick = tick()
- local currenttab = nil
- local debounceinv = false
- local function LoadInv(name)
- if debounceinv == false then
- debounceinv = true
- currenttab = name
- 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
- script.Parent.Inventory[name].BorderSizePixel = 0
- script.Parent.Inventory[name].ZIndex = 1
- for _, i in pairs(script.Parent.Inventory.Frame:GetChildren()) do i:Destroy() end
- -- CALCULATING Y AND CANVASSIZE
- local YY = math.floor(#script.Inventory[name]:GetChildren() / 5)
- if #script.Inventory[name]:GetChildren() % 5 ~= 0 then
- YY = YY + 1
- end
- local YC = 1 / YY
- if YY < 4 then
- YC = 0.25
- end
- for num, i in pairs(script.Inventory[name]:GetChildren()) do
- num = num - 1
- local position = num % 5
- local line = ( num - position ) / 5
- local Image = nil
- if not InTrade then
- if i:FindFirstChild("OnUse") then
- Image = Instance.new("ImageButton", script.Parent.Inventory.Frame)
- Image.MouseButton1Click:connect(function()
- if UseTick + 1 < tick() then
- UseTick = tick() + 99999
- if CallServer("CheckForStat", i.Stat.Value) > 0 then
- local candecrease = false
- for _, o in pairs(mod(i.OnUse.Value)) do
- if o[1] == "HBP" then
- candecrease = true
- CallServer("HealPlayer", tonumber(o[2]) / 100 * CallServer("GetMaxHP"))
- elseif o[1] == "H" then
- candecrease = true
- CallServer("HealPlayer", tonumber(o[2]))
- elseif o[1] == "G" then
- candecrease = true
- CallServer("IncreaseStat", o[2], tonumber(o[3]))
- elseif o[1] == "GLVL" then
- if CallServer("GetLVL") ~= 100 then
- CallServer("IncreaseLVL", 1)
- candecrease = true
- end
- elseif o[1] == "SUMMONBOSS" then
- if CallServer("SummonBoss") then
- candecrease = true
- end
- elseif o[1] == "EGGTRACKER" then
- if openedframe ~= "TRADE" then script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true) end
- if openedframe == "Inv" then
- openedframe = ""
- end
- EggTracker_OnClick()
- end
- end
- if candecrease then CallServer("DecreaseStat", i.Stat.Value, 1) end
- LoadInv(name)
- end
- UseTick = tick()
- end
- end)
- else
- Image = Instance.new("ImageLabel", script.Parent.Inventory.Frame)
- end
- else
- if i:FindFirstChild("Tradeable") then
- Image = Instance.new("ImageButton", script.Parent.Inventory.Frame)
- Image.MouseButton1Click:connect(function()
- if CallServer("CheckForStat", i.Stat.Value) > 0 then
- Trade_ChangeRequest("Add", i)
- end
- end)
- else
- Image = Instance.new("ImageLabel", script.Parent.Inventory.Frame)
- end
- end
- Image.Image = "rbxassetid://"..i.Image.Value
- Image.BackgroundTransparency = 1
- Image.Position = UDim2.new((position * 0.2), 0, (line * YC), 0)
- Image.Size = UDim2.new(0.15, 0, YC / 4 * 3, 0)
- local text = Instance.new("TextLabel", script.Parent.Inventory.Frame)
- text.BackgroundTransparency = 1
- text.Position = UDim2.new((position * 0.2) + 0.10, 0, (line * YC) + (YC / 2), 0)
- text.Size = UDim2.new(0.05, 0, YC / 4, 0)
- text.Font = Enum.Font.ArialBold
- text.TextScaled = true
- text.TextColor3 = Color3.new(1,1,1)
- local text2 = Instance.new("TextLabel", script.Parent.Inventory.Frame)
- text2.BackgroundTransparency = 1
- text2.Position = UDim2.new((position * 0.2), 0, (line * YC) + (YC / 4 * 3), 0)
- text2.Size = UDim2.new(0.15, 0, (YC / 20 * 6), 0)
- text2.Font = Enum.Font.ArialBold
- text2.TextScaled = true
- text2.Text = i.Name
- text2.TextColor3 = Color3.new(1,1,1)
- text.Text = "x"
- text.Text = "x" .. Stats.GetStat(i.Stat.Value)
- if (line + 1) * 0.25 < 1 then
- script.Parent.Inventory.Frame.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- script.Parent.Inventory.Frame.CanvasSize = UDim2.new(0, 0, (line + 1) * 0.25, 0)
- end
- end
- debounceinv = false
- end
- end
- local X = 1 / #script.Inventory:GetChildren()
- for num = 1, #script.Inventory:GetChildren(), 1 do
- for _, i in pairs(script.Inventory:GetChildren()) do
- if string.sub(i.Name, 1, 1) == tostring(num) then
- local but = Instance.new("TextButton", script.Parent.Inventory)
- but.Name = i.Name
- but.Transparency = 0
- but.BackgroundColor3 = Color3.new(65/255, 65/255, 65/255)
- but.BorderSizePixel = 3
- but.BorderColor3 = Color3.new(0, 0, 0)
- but.Font = Enum.Font.SourceSansBold
- but.Text = string.sub(i.Name, 2)
- but.TextColor3 = Color3.new(1, 1, 1)
- but.TextScaled = true
- but.Size = UDim2.new(X, 0, 0.1, 0)
- but.Position = UDim2.new((num - 1) * X, 0, 0, 0)
- but.ZIndex = 2
- -- FUNCTIONS
- but.MouseButton1Click:connect(function() LoadInv(i.Name) end)
- end
- end
- end
- 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)
- script.Parent.HideBar.Inventory.MouseButton1Click:connect(function()
- if openedframe == "Inv" then
- script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = ""
- elseif openedframe == "" then
- if currenttab ~= nil then spawn(function() LoadInv(currenttab) end) end
- script.Parent.Inventory:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = "Inv"
- end
- end)
- script.Parent.Inventory.Exit.MouseButton1Click:connect(function()
- if openedframe ~= "TRADE" then script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true) end
- if openedframe == "Inv" then
- openedframe = ""
- end
- end)
- -- TRADING
- local Trade_Debounce = false
- local func = nil
- function Trade_Pending(cfunc)
- func = cfunc
- local responded = false
- local function Respond(state)
- if not responded then
- responded = true
- CallServer("Trade", "Respond", func.Id, state)
- end
- end
- if not Trade_Debounce then
- if CheckAcceptionSupport() then
- local currentacceptationid = AddOnAcception(
- function(state)
- Respond(state)
- return "Successfuly "..(state and "accepted" or "declined").." the request!"
- end,
- "You have received trade request from "..func.Sender
- )
- wait(16)
- if accfuncid == currentacceptationid then
- ResetOnAcceptation()
- end
- Respond(false)
- else
- local callback = Instance.new("BindableFunction")
- callback.Parent = script
- callback.Name = "TradeCallback"
- callback.OnInvoke = function(answer)
- local accepted = answer == "Accept"
- if accepted then if Trade_Debounce then accepted = false end end
- if accepted then Trade_Debounce = true end
- Respond(accepted)
- end
- game.StarterGui:SetCore("SendNotification", {
- Title = "Trade request",
- Text = "You have received trade request from "..func.Sender,
- Icon = "",
- Duration = 10,
- Callback = callback,
- Button1 = "Accept",
- Button2 = "Decline"
- })
- wait(11)
- Respond(false)
- end
- else
- Respond(false)
- end
- end
- local tradeuser = nil
- local tradesguy = nil
- local currentoffer = nil
- function Trade_Started(cfunc)
- func = cfunc
- Trade_Debounce = true
- if func.Sender == game.Players.LocalPlayer.Name then
- tradeuser = "Sender"
- tradesguy = "Receiver"
- elseif func.Receiver == game.Players.LocalPlayer.Name then
- tradeuser = "Receiver"
- tradesguy = "Sender"
- end
- script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.HideBar.Visible = false
- script.Parent.InfoBar.Visible = false
- script.Parent.Expand.Visible = false
- game.Players.LocalPlayer.PlayerGui.SkillsGui.Holder:TweenPosition(UDim2.new(0.3, 0, 1.5, 0), "Out", "Quad", 1, true)
- script.Parent.ChatFrame:TweenPosition(UDim2.new(0.005, 0, 0.701, 0), "Out", "Quad", 1, true)
- script.Parent.Inventory:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true)
- script.Parent.TradeFrame:TweenPosition(UDim2.new(0.5, 0, 0, 0), "Out", "Quad", 1, true)
- InTrade = true
- currentoffer = func[tradeuser.."Offer"]
- script.Parent.TradeFrame.OTHEROFFER.Header.Text = func[tradesguy].."'s offer"
- 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)
- openedframe = "TRADE"
- function Trade_Change(t, newval)
- if tradeuser ~= nil then
- if t == "BattlePoints" then if newval > 50 then newval = 50 end end
- if t == "Cash" then if newval > 3000 then newval = 3000 end end
- if t == "Bux" then if newval > 300 then newval = 300 end end
- currentoffer[t] = newval
- CallServer("Trade", "UpdateOffer", func.Id, tradeuser, currentoffer)
- end
- end
- end
- local accepted = false
- local acceptation = 1
- script.Parent.TradeFrame.Accept.MouseButton1Click:connect(function()
- if not tradeuser then return end
- if acceptation == 1 then
- accepted = not accepted
- CallServer("Trade", "Accept", func.Id, tradeuser, accepted)
- elseif acceptation == 2 then
- accepted = not accepted
- CallServer("Trade", "Accept2", func.Id, tradeuser, accepted)
- end
- end)
- script.Parent.TradeFrame.Cancel.MouseButton1Click:connect(function()
- if InTrade then
- CallServer("Trade", "Cancel", func.Id)
- end
- end)
- local tradechangedebounce = true
- function Trade_ChangeRequest(at, thing, newval)
- if tradechangedebounce then
- tradechangedebounce = false
- if at == "Remove" then
- currentoffer["Items"][thing] = nil
- for i = thing, 4, 1 do
- currentoffer["Items"][i] = currentoffer["Items"][i + 1]
- end
- currentoffer["Items"][5] = nil
- elseif at == "Add" then
- local id = nil
- for index, i in pairs(currentoffer["Items"]) do
- if i.Stat == thing.Stat.Value then
- id = index
- end
- end
- if id == nil then
- if CallServer("GetStat", thing.Stat.Value) >= 1 then
- currentoffer["Items"][#currentoffer["Items"] + 1] = {Stat = thing.Stat.Value, Data = thing, Name = thing.Name, Amount = 1}
- end
- else
- if CallServer("GetStat", thing.Stat.Value) >= currentoffer["Items"][id].Amount + 1 then
- currentoffer["Items"][id].Amount = currentoffer["Items"][id].Amount + 1
- end
- end
- elseif at == "ChangeAmount" then
- if newval >= 0 then
- if CallServer("GetStat", currentoffer["Items"][thing]["Stat"]) >= newval then
- currentoffer["Items"][thing]["Amount"] = newval
- else
- currentoffer["Items"][thing]["Amount"] = CallServer("GetStat", currentoffer["Items"][thing]["Stat"])
- end
- else
- currentoffer["Items"][thing]["Amount"] = 0
- end
- end
- Trade_Change("Items", currentoffer["Items"])
- tradechangedebounce = true
- end
- end
- for _, i in pairs(script.Parent.TradeFrame.YOUROFFER:GetChildren()) do
- if i:IsA'Frame' then
- i.HitBox.MouseButton1Click:connect(function()
- if currentoffer["Items"][tonumber(i.Name)] then
- Trade_ChangeRequest("Remove", tonumber(i.Name))
- end
- end)
- end
- end
- script.Parent.TradeFrame.YOUROFFER.Coins.FocusLost:connect(function()
- if tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text) ~= nil then
- if tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text) <= CallServer("GetStat", "Cash") then
- if tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text) >= 0 then
- Trade_Change("Cash", tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text))
- else
- script.Parent.TradeFrame.YOUROFFER.Coins.Text = "0"
- end
- else
- script.Parent.TradeFrame.YOUROFFER.Coins.Text = tostring(CallServer("GetStat", "Cash"))
- Trade_Change("Cash", tonumber(script.Parent.TradeFrame.YOUROFFER.Coins.Text))
- end
- end
- end)
- script.Parent.TradeFrame.YOUROFFER.Bux.FocusLost:connect(function()
- if tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text) ~= nil then
- if tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text) <= CallServer("GetStat", "PokeBux") then
- if tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text) >= 0 then
- Trade_Change("Bux", tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text))
- else
- script.Parent.TradeFrame.YOUROFFER.Bux.Text = "0"
- end
- else
- script.Parent.TradeFrame.YOUROFFER.Bux.Text = tostring(CallServer("GetStat", "PokeBux"))
- Trade_Change("Bux", tonumber(script.Parent.TradeFrame.YOUROFFER.Bux.Text))
- end
- end
- end)
- script.Parent.TradeFrame.YOUROFFER.BattlePoints.FocusLost:connect(function()
- if tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text) ~= nil then
- if tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text) <= CallServer("GetStat", "BP") then
- if tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text) >= 0 then
- Trade_Change("BattlePoints", tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text))
- else
- script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = "0"
- end
- else
- script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = tostring(CallServer("GetStat", "BP"))
- Trade_Change("BattlePoints", tonumber(script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text))
- end
- end
- end)
- -- UPDATE GUIS
- local ImageHolder = {}
- for _, i in pairs(script.Inventory:GetChildren()) do
- for _, a in pairs(i:GetChildren()) do
- if a:FindFirstChild("Image") then
- ImageHolder[a.Name] = a.Image.Value
- end
- end
- end
- function Trade_Changed(cfunc)
- func = cfunc
- Trade_CleanGui(false)
- if tradeuser == nil then return end
- -- LocalPlayer
- if cfunc["Acceptation2Frame"] == true then
- acceptation = 2
- accepted = cfunc[tradeuser.."Accepted2"]
- script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0, 0), "Out", "Quad", 1, true)
- script.Parent.TradeFrame:TweenPosition(UDim2.new(0.25, 0, 0, 0), "Out", "Quad", 1, true)
- else
- acceptation = 1
- accepted = cfunc[tradeuser.."Accepted"]
- script.Parent.Inventory:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true)
- script.Parent.TradeFrame:TweenPosition(UDim2.new(0.5, 0, 0, 0), "Out", "Quad", 1, true)
- end
- script.Parent.TradeFrame.YOUROFFER.Bux.Text = tostring(cfunc[tradeuser.."Offer"].Bux)
- script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = tostring(cfunc[tradeuser.."Offer"].BattlePoints)
- script.Parent.TradeFrame.YOUROFFER.Coins.Text = tostring(cfunc[tradeuser.."Offer"].Cash)
- if acceptation == 1 then
- script.Parent.TradeFrame.YOUROFFER.READY.Text = cfunc[tradeuser.."Accepted"] and "READY" or "NOT READY"
- script.Parent.TradeFrame.YOUROFFER.READY.TextColor3 = cfunc[tradeuser.."Accepted"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
- elseif acceptation == 2 then
- script.Parent.TradeFrame.YOUROFFER.READY.Text = cfunc[tradeuser.."Accepted2"] and "ACCEPTED" or "NOT ACCEPTED"
- script.Parent.TradeFrame.YOUROFFER.READY.TextColor3 = cfunc[tradeuser.."Accepted2"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
- end
- for num, i in pairs(cfunc[tradeuser.."Offer"].Items) do
- if script.Parent.TradeFrame.YOUROFFER:FindFirstChild(tostring(num)) then
- local img = Instance.new("ImageLabel", script.Parent.TradeFrame.YOUROFFER[tostring(num)])
- img.BackgroundTransparency = 1
- img.Position = UDim2.new(0,0,0,0)
- img.Size = UDim2.new(1,0,1,0)
- img.Image = "rbxassetid://"..tostring(ImageHolder[i.Name])
- img.ZIndex = 8
- local textbox = Instance.new("TextBox", script.Parent.TradeFrame.YOUROFFER[tostring(num)])
- textbox.BackgroundTransparency = 1
- textbox.Position = UDim2.new(0.5, 0, 0.7, 0)
- textbox.Size = UDim2.new(0.5, 0, 0.3, 0)
- textbox.TextXAlignment = "Right"
- textbox.TextScaled = true
- textbox.TextColor3 = Color3.new(1,1,1)
- textbox.Font = "ArialBold"
- textbox.Text = tostring(i.Amount)
- textbox.ZIndex = 10
- textbox.FocusLost:connect(function()
- if tonumber(textbox.Text) ~= nil then
- if tonumber(textbox.Text) >= 1 then
- if tonumber(textbox.Text) > CallServer("GetStat", i["Stat"]) then
- textbox.Text = tostring(CallServer("GetStat", i["Stat"]))
- end
- Trade_ChangeRequest("ChangeAmount", num, tonumber(textbox.Text))
- else
- textbox.Text = "1"
- end
- end
- end)
- end
- end
- -- OtherPlayer
- script.Parent.TradeFrame.OTHEROFFER.Bux.Text = tostring(cfunc[tradesguy.."Offer"].Bux)
- script.Parent.TradeFrame.OTHEROFFER.BattlePoints.Text = tostring(cfunc[tradesguy.."Offer"].BattlePoints)
- script.Parent.TradeFrame.OTHEROFFER.Coins.Text = tostring(cfunc[tradesguy.."Offer"].Cash)
- if acceptation == 1 then
- script.Parent.TradeFrame.Accept.Text = "Trade!"
- script.Parent.TradeFrame.Cancel.Text = "Cancel"
- script.Parent.TradeFrame.OTHEROFFER.READY.Text = cfunc[tradesguy.."Accepted"] and "READY" or "NOT READY"
- script.Parent.TradeFrame.OTHEROFFER.READY.TextColor3 = cfunc[tradesguy.."Accepted"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
- elseif acceptation == 2 then
- script.Parent.TradeFrame.Accept.Text = "Accept!"
- script.Parent.TradeFrame.Cancel.Text = "Decline"
- script.Parent.TradeFrame.OTHEROFFER.READY.Text = cfunc[tradesguy.."Accepted2"] and "ACCEPTED" or "NOT ACCEPTED"
- script.Parent.TradeFrame.OTHEROFFER.READY.TextColor3 = cfunc[tradesguy.."Accepted2"] and Color3.new(0, 175/255, 0) or Color3.new(175/255, 0, 0)
- end
- for num, i in pairs(cfunc[tradesguy.."Offer"].Items) do
- if script.Parent.TradeFrame.OTHEROFFER:FindFirstChild(tostring(num)) then
- local img = Instance.new("ImageLabel", script.Parent.TradeFrame.OTHEROFFER[tostring(num)])
- img.BackgroundTransparency = 1
- img.Position = UDim2.new(0,0,0,0)
- img.Size = UDim2.new(1,0,1,0)
- img.Image = "rbxassetid://"..tostring(ImageHolder[i.Name])
- img.ZIndex = 8
- local textbox = Instance.new("TextLabel", script.Parent.TradeFrame.OTHEROFFER[tostring(num)])
- textbox.BackgroundTransparency = 1
- textbox.Position = UDim2.new(0.5, 0, 0.7, 0)
- textbox.Size = UDim2.new(0.5, 0, 0.3, 0)
- textbox.TextXAlignment = "Right"
- textbox.TextScaled = true
- textbox.TextColor3 = Color3.new(1,1,1)
- textbox.Font = "ArialBold"
- textbox.Text = tostring(i.Amount)
- textbox.ZIndex = 10
- end
- end
- end
- function Trade_CleanGui(clrall)
- for _, i in pairs(script.Parent.TradeFrame.YOUROFFER:GetChildren()) do
- if i:IsA'Frame' then
- for _, a in pairs(i:GetChildren()) do
- if a.Name ~= "HitBox" then
- a:Destroy()
- end
- end
- end
- end
- for _, i in pairs(script.Parent.TradeFrame.OTHEROFFER:GetChildren()) do
- if i:IsA'Frame' then
- for _, a in pairs(i:GetChildren()) do
- if a.Name ~= "HitBox" then
- a:Destroy()
- end
- end
- end
- end
- if clrall then
- acceptation = 1
- accepted = false
- script.Parent.TradeFrame.Accept.Text = "Trade!"
- script.Parent.TradeFrame.Cancel.Text = "Cancel"
- script.Parent.TradeFrame.YOUROFFER.Coins.Text = "0"
- script.Parent.TradeFrame.YOUROFFER.Bux.Text = "0"
- script.Parent.TradeFrame.YOUROFFER.BattlePoints.Text = "0"
- script.Parent.TradeFrame.YOUROFFER.READY.Text = "NOT READY"
- script.Parent.TradeFrame.YOUROFFER.READY.TextColor3 = Color3.new(175/255, 0, 0)
- script.Parent.TradeFrame.OTHEROFFER.Coins.Text = "0"
- script.Parent.TradeFrame.OTHEROFFER.Bux.Text = "0"
- script.Parent.TradeFrame.OTHEROFFER.BattlePoints.Text = "0"
- script.Parent.TradeFrame.OTHEROFFER.READY.Text = "NOT READY"
- script.Parent.TradeFrame.OTHEROFFER.READY.TextColor3 = Color3.new(175/255, 0, 0)
- script.Parent.TradeFrame.OTHEROFFER.Header.Text = "PLAYER's offer"
- end
- end
- function Trade_Ended(cfunc)
- func = cfunc
- game.StarterGui:SetCore("SendNotification", {
- Title = "Trade has ended",
- Text = func.EndMessage,
- Icon = "",
- Duration = 10,
- })
- InTrade = false
- currentoffer = nil
- 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)
- tradeuser = nil
- tradesguy = nil
- script.Parent.HideBar.Visible = true
- script.Parent.InfoBar.Visible = true
- script.Parent.Expand.Visible = true
- game.Players.LocalPlayer.PlayerGui.SkillsGui.Holder:TweenPosition(UDim2.new(0.3, 0, 0.85, 0), "Out", "Quad", 1, true)
- script.Parent.ChatFrame:TweenPosition(UDim2.new(0.0005, 0, 0.201, 0), "Out", "Quad", 1, true)
- script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.TradeFrame:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- Trade_CleanGui(true)
- Trade_Debounce = false
- openedframe = ""
- end
- -- EVOLVES
- local curdir = script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]
- local curevolvelvl = 0 -- After evolving it raises and raises
- local alreadyevolved = false
- local function FindPreviousPokemon(dir)
- local parent
- if dir.Parent.Name ~= "Evolves" then
- parent = dir
- else
- parent = dir.Parent
- end
- if parent ~= nil then
- if parent.Parent.Parent.Name ~= "Pokemons" then
- return parent.Parent
- else
- return parent
- end
- end
- end
- local function ExecuteEvolveLoading()
- local currentevolvelevel = curevolvelvl
- local curevolve = ""
- function LoadEv(name)
- curevolve = name
- script.Parent.Evolves.pname.Text = name
- script.Parent.Evolves.needs.Text = "Needs:\n"
- for _, i in pairs(script.Parent.Evolves:GetChildren()) do if i:IsA'TextButton' and i.Name ~= "Exit" and i.Name ~= "evolve" then
- i.BorderSizePixel = 3
- i.ZIndex = 3
- if i.Name == name then
- i.BorderSizePixel = 0
- i.ZIndex = 2
- end
- end end
- local decoded = nil
- if curdir:FindFirstChild("Evolves") then
- if curdir.Evolves:FindFirstChild(curevolve) then
- if curdir.Evolves[curevolve]:FindFirstChild("Need") then
- decoded = mod(curdir.Evolves[curevolve].Need.Value)
- end
- end
- else
- if curdir:FindFirstChild(curevolve) then
- if curdir[curevolve]:FindFirstChild("Need") then
- decoded = mod(curdir[curevolve].Need.Value)
- end
- end
- end
- if decoded ~= nil then
- for _, i in pairs(decoded) do
- if i[1] == "LVL" then
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. i[2] .. " Level"
- elseif i[1] == "C" then
- for id, v in pairs(mod2(i[2])) do
- if id ~= 1 then
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " or "
- end
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. v .. " x" .. i[3]
- end
- elseif i[1] == "T" then
- for id, v in pairs(mod2(i[2])) do
- if id ~= 1 then
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " or "
- end
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. v .. " x" .. i[3]
- end
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. " (will be taken)"
- elseif i[1] == "DAY" then
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "Day needed"
- elseif i[1] == "NIGHT" then
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "Night needed"
- end
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "\n"
- end
- else
- script.Parent.Evolves.needs.Text = script.Parent.Evolves.needs.Text .. "No needs"
- end
- end
- local debounce = true
- script.Parent.Evolves.evolve.MouseButton1Click:connect(function()
- if debounce == true then
- debounce = false
- -- EVOLVING FUNCTION
- if currentevolvelevel == curevolvelvl and curevolve ~= nil and curevolve ~= "" then
- local canevolve = true
- local decoded = nil
- local mega = false
- local randback = false
- if curevolve ~= "Random" and curevolve ~= "Back" then
- if curdir:FindFirstChild("Evolves") then
- if curdir.Evolves:FindFirstChild(curevolve) then
- if curdir.Evolves[curevolve]:FindFirstChild("MegaEvolution") then
- mega = true
- end
- if curdir.Evolves[curevolve]:FindFirstChild("Need") then
- decoded = mod(curdir.Evolves[curevolve].Need.Value)
- end
- end
- else
- if curdir:FindFirstChild(curevolve) then
- if curdir[curevolve]:FindFirstChild("MegaEvolution") then
- mega = true
- end
- if curdir[curevolve]:FindFirstChild("Need") then
- decoded = mod(curdir[curevolve].Need.Value)
- end
- end
- end
- if decoded ~= nil then
- for _, i in pairs(decoded) do
- if i[1] == "LVL" then
- if CallServer("GetLVL") < tonumber(i[2]) then
- canevolve = false
- end
- elseif i[1] == "C" then
- local passed = false
- for id, v in pairs(mod2(i[2])) do
- if Stats.GetStat(v) >= tonumber(i[3]) then
- passed = true
- end
- end
- if not passed then canevolve = false end
- elseif i[1] == "T" then
- local passed = false
- for id, v in pairs(mod2(i[2])) do
- if Stats.GetStat(v) >= tonumber(i[3]) then
- passed = true
- end
- end
- if not passed then canevolve = false end
- elseif i[1] == "DAY" then
- if CallServer("DayNight") ~= "D" then
- canevolve = false
- end
- elseif i[1] == "NIGHT" then
- if CallServer("DayNight") ~= "N" then
- canevolve = false
- end
- end
- end
- end
- elseif curevolve == "Back" then
- if curdir:FindFirstChild("Evolves") then
- if curdir.Evolves:FindFirstChild("Random") then
- randback = true
- end
- else
- if curdir:FindFirstChild("Random") then
- randback = true
- end
- end
- end
- -- EVOLVE REQUIREMENTS CHECK
- if canevolve then
- local evolved = nil
- if not mega then
- if curevolve == "Back" then
- if randback then
- evolved = CallServer("Evolve", curdir.Name)
- else
- evolved = CallServer("Evolve", FindPreviousPokemon(curdir).Name)
- end
- else
- evolved = CallServer("Evolve", curevolve)
- end
- else
- evolved = CallServer("MegaEvolve", curevolve)
- end
- if evolved then
- -- TAKING ITEMS
- if curevolve ~= "Random" and curevolve ~= "Back" then
- if decoded ~= nil then
- for _, i in pairs(decoded) do
- if i[1] == "T" then
- for id, v in pairs(mod2(i[2])) do
- if Stats.GetStat(v) >= tonumber(i[3]) then
- CallServer("ChangeStat", v, Stats.GetStat(v) - tonumber(i[3]))
- break
- end
- end
- end
- end
- end
- end
- if curevolve ~= "Random" and curevolve ~= "Back" then
- script.Parent.InfoBar:FindFirstChild("Name").Text = curevolve
- elseif curevolve == "Back" and not randback then
- script.Parent.InfoBar:FindFirstChild("Name").Text = FindPreviousPokemon(curdir).Name
- end
- script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = ""
- curevolvelvl = curevolvelvl + 1
- if curevolve ~= "Random" and curevolve ~= "Back" and not mega then
- if curdir:FindFirstChild("Evolves") then
- curdir = curdir.Evolves:FindFirstChild(curevolve)
- elseif curdir:FindFirstChild(curevolve) then
- curdir = curdir:FindFirstChild(curevolve)
- end
- elseif curevolve == "Back" and not randback then
- curdir = FindPreviousPokemon(curdir)
- end
- script.Parent.Evolves.needs.Text = "Needs:"
- script.Parent.Evolves.pname.Text = "Choose an evolution!"
- if curevolve == "Random" then
- alreadyevolved = true
- elseif curevolve == "Back" and randback then
- alreadyevolved = false
- end
- local tl = nil
- if mega then
- tl = Instance.new("TextLabel", script.Parent)
- tl.Position = UDim2.new(0.7, 0, 1, 0)
- tl.Size = UDim2.new(0.3, 0, 0.05, 0)
- tl.BackgroundTransparency = 1
- tl.TextColor3 = Color3.new(1,1,1)
- tl.TextScaled = true
- tl.Text = "De-evolving in 180 seconds!"
- tl:TweenPosition(UDim2.new(0.7, 0, 0.95, 0), "Out", "Quad", 1, true)
- end
- local towait = mega == true and 180 or 10
- while towait ~= 0 do
- if tl then tl.Text = "De-evolving in "..tostring(towait).." seconds!" end
- script.Parent.InfoBar.Evolve.Text = "Wait "..tostring(mega and towait + 120 or towait).." seconds"
- towait = towait - 1
- wait(1)
- end
- if tl then tl:TweenPosition(UDim2.new(0.7, 0, 1, 0), "Out", "Quad", 1, true, function() tl:Destroy() end) end
- if mega then
- CallServer("Evolve", curdir.Name, 1)
- script.Parent.InfoBar:FindFirstChild("Name").Text = curdir.Name
- towait = 120
- while towait ~= 0 do
- script.Parent.InfoBar.Evolve.Text = "Wait "..tostring(towait).." seconds"
- towait = towait - 1
- wait(1)
- end
- end
- script.Parent.InfoBar.Evolve.Text = "Evolve"
- ExecuteEvolveLoading()
- end
- end
- end
- debounce = true
- end
- end)
- -- GETTING LIST OF EVOS
- local tab = {} -- EVOS
- if curdir:FindFirstChild("Evolves") then
- for _, i in pairs(curdir.Evolves:GetChildren()) do
- if i.Name == "Random" then
- table.insert(tab, {Name = "Random"})
- if alreadyevolved then
- table.insert(tab, {Name = "Back"})
- end
- else
- table.insert(tab, i)
- end
- end
- else
- for _, i in pairs(curdir:GetChildren()) do
- if i:IsA'Folder' and i.Name ~= "SetStatsOnSpawn" and i.Name ~= "Weapons" and i.Name ~= "Spawns" then
- if i.Name == "Random" then
- table.insert(tab, {Name = "Random"})
- if alreadyevolved then
- table.insert(tab, {Name = "Back"})
- end
- else
- table.insert(tab, i)
- end
- end
- end
- end
- 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
- local X = 0
- if #tab ~= 0 then X = 1 / #tab end
- for num, i in pairs(tab) do
- local but = Instance.new("TextButton", script.Parent.Evolves)
- but.Name = i.Name
- but.Transparency = 0
- but.BackgroundColor3 = Color3.new(65/255, 65/255, 65/255)
- but.BorderSizePixel = 3
- but.BorderColor3 = Color3.new(0, 0, 0)
- but.Font = Enum.Font.SourceSansBold
- but.Text = i.Name
- but.TextColor3 = Color3.new(1, 1, 1)
- but.TextScaled = true
- but.Size = UDim2.new(X, 0, 0.1, 0)
- but.Position = UDim2.new((num - 1) * X, 0, 0, 0)
- but.ZIndex = 2
- -- FUNCTIONS
- but.MouseButton1Click:connect(function() LoadEv(i.Name) end)
- end
- if tab[1] ~= nil then
- LoadEv(tab[1].Name)
- end
- end
- ExecuteEvolveLoading()
- script.Parent.InfoBar.Evolve.MouseButton1Click:connect(function()
- if openedframe == "Ev" then
- script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = ""
- elseif openedframe == "" then
- if script.Parent.InfoBar.Evolve.Text == "Evolve" then
- script.Parent.Evolves:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = "Ev"
- end
- end
- end)
- script.Parent.Evolves.Exit.MouseButton1Click:connect(function()
- script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- if openedframe == "Ev" then
- openedframe = ""
- end
- end)
- -- PVP
- local pvp = CallServer("GetStat", "PvP")
- if pvp == 0 then
- script.Parent.HideBar.PvP.Text = "Enable PvP"
- elseif pvp == 1 then
- script.Parent.HideBar.PvP.Text = "Disable PvP"
- end
- local PVPFDebounce = true
- local Time = 0
- function PVPDebounce()
- if PVPFDebounce then
- PVPFDebounce = false
- local curpvp = pvp
- pvp = 0.5
- while Time ~= 0 do
- script.Parent.HideBar.PvP.Text = "Wait "..tostring(Time).." seconds!"
- Time = Time - 1
- wait(1)
- end
- pvp = curpvp
- if pvp == 1 then
- script.Parent.HideBar.PvP.Text = "Disable PvP"
- elseif pvp == 0 then
- script.Parent.HideBar.PvP.Text = "Enable PvP"
- end
- PVPFDebounce = true
- end
- end
- script.Parent.HideBar.PvP.MouseButton1Click:connect(function()
- if pvp == 0 then
- pvp = 1
- CallServer("ChangeStat", "PvP", pvp)
- script.Parent.HideBar.PvP.Text = "Disable PvP"
- elseif pvp == 1 then
- pvp = 0
- CallServer("ChangeStat", "PvP", pvp)
- script.Parent.HideBar.PvP.Text = "Enable PvP"
- end
- end)
- script.WeaponUsed.Changed:connect(function()
- if script.WeaponUsed.Value ~= false then
- script.WeaponUsed.Value = false
- Time = 60
- PVPDebounce()
- end
- end)
- -- MUSIC
- local mute = CallServer("GetStat", "Mute")
- if mute == 0 then
- script.Parent.HideBar.Music.Text = "Mute music"
- elseif mute == 1 then
- script.Parent.HideBar.Music.Text = "Unmute music"
- end
- script.Parent.HideBar.Music.MouseButton1Click:connect(function()
- if mute == 0 then
- mute = 1
- CallServer("ChangeStat", "Mute", mute)
- script.Parent.HideBar.Music.Text = "Unmute music"
- elseif mute == 1 then
- mute = 0
- CallServer("ChangeStat", "Mute", mute)
- script.Parent.HideBar.Music.Text = "Mute music"
- end
- end)
- -- MAKING LEADERBOARD
- function UpdateLeaderboard()
- script.Parent.Leaderboard.Points.Text = "Your points: "..tostring(CallServer("GetStat", "Rep"))
- for _, i in pairs(script.Parent.Leaderboard.Frame:GetChildren()) do
- i:Destroy()
- end
- local pages = CallServer("GetLeaderBoard")
- local getusernamefromid = require(script.GetUserNameFromId)
- if pages ~= nil then
- for num, i in pairs(pages) do
- if num ~= nil and getusernamefromid(i.key) ~= nil and i.key ~= nil and i.value ~= nil then
- local frame = Instance.new("Frame", script.Parent.Leaderboard.Frame)
- frame.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
- frame.Position = UDim2.new(0, 0, (num - 1) * 0.1, 0)
- frame.Size = UDim2.new(1, 0, 0.1, 0)
- frame.BorderColor3 = Color3.new(0,0,0)
- frame.BorderSizePixel = 2
- local textlabel = Instance.new("TextLabel", frame)
- textlabel.BackgroundTransparency = 1
- textlabel.Position = UDim2.new(0,0,0,0)
- textlabel.Size = UDim2.new(1, 0, 1, 0)
- textlabel.TextColor3 = Color3.new(1,1,1)
- textlabel.TextScaled = true
- textlabel.Font = Enum.Font.ArialBold
- textlabel.Text = tostring(num)..". "..getusernamefromid(i.key).." ("..tostring(i.value).." points)"
- end
- end
- end
- end
- local Camera = game:GetService("Workspace").CurrentCamera
- local HasEggTracker = false
- script.Parent.EggTracker.PurchaseFrame.TextButton.MouseButton1Click:Connect(function()
- game:GetService("MarketplaceService"):PromptPurchase(game.Players.LocalPlayer, 1565993463)
- end)
- script.Parent.EggTracker.Exit.MouseButton1Click:Connect(function()
- if openedframe == "EggTracker" then
- script.Parent.EggTracker:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = ""
- end
- end)
- local EggTrackerScalingObjects = {
- script.Parent.EggTracker.EggArrow_1,
- script.Parent.EggTracker.EggArrow_2,
- script.Parent.EggTracker.EggArrow_3,
- script.Parent.EggTracker.EggArrow_4,
- script.Parent.EggTracker.EggArrow_5,
- script.Parent.EggTracker.Radar,
- script.Parent.EggTracker.PurchaseFrame.GamepassImg
- }
- function EggTracker_OnClick()
- if openedframe == "EggTracker" then
- script.Parent.EggTracker:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = ""
- elseif openedframe == "" then
- script.Parent.EggTracker:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = "EggTracker"
- local Eggs = game:GetService("Workspace").Regens["Regen (Eggs)"]
- while openedframe == "EggTracker" do
- for _, obj in pairs(EggTrackerScalingObjects) do
- obj.Size = UDim2.new(0, obj.AbsoluteSize.Y, obj.Size.Y.Scale, obj.Size.Y.Offset)
- end
- if HasEggTracker then
- script.Parent.EggTracker.PurchaseFrame.Visible = false
- if game.Players.LocalPlayer.Character ~= nil then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- local CameraRay = Ray.new(Camera.CFrame.p, game.Players.LocalPlayer.Character.Torso.Position - Camera.CFrame.p)
- local CameraAngle = math.atan2(CameraRay.Unit.Direction.X, CameraRay.Unit.Direction.Z)
- local MaxEggs = 0
- for _, Egg in pairs(Eggs:GetChildren()) do
- if not Egg:IsA'Script' then
- if Egg:FindFirstChild("HitBox") ~= nil then
- MaxEggs = MaxEggs + 1
- local Distance = (Egg.HitBox.Position - game.Players.LocalPlayer.Character.Torso.Position).Magnitude
- local EggRay = Ray.new(Egg.HitBox.Position, game.Players.LocalPlayer.Character.Torso.Position - Egg.HitBox.Position)
- local EggAngle = math.atan2(EggRay.Unit.Direction.X, EggRay.Unit.Direction.Z)
- local Angle = math.deg(CameraAngle - EggAngle + math.cos(tick()) * 0.1)
- local EggArrow = script.Parent.EggTracker["EggArrow_"..MaxEggs]
- EggArrow.Rotation = Angle + 180
- local rgb = Vector3.new(0, 255, 0):Lerp(Vector3.new(255, 0, 0), (Distance / 1000))
- EggArrow.ImageColor3 = Color3.new(rgb.X / 255, rgb.Y / 255, rgb.Z / 255)
- EggArrow.Visible = true
- end
- end
- end
- for Egg = MaxEggs + 1, 5 do
- local EggArrow = script.Parent.EggTracker["EggArrow_"..Egg]
- EggArrow.ImageColor3 = Color3.new(1,1,1)
- EggArrow.Rotation = 0
- EggArrow.Visible = false
- end
- if MaxEggs == 1 then
- script.Parent.EggTracker.Count.Text = "There is currently "..MaxEggs.." egg on the map."
- else
- script.Parent.EggTracker.Count.Text = "There are currently "..MaxEggs.." eggs on the map."
- end
- end
- end
- else
- script.Parent.EggTracker.PurchaseFrame.Visible = true
- end
- game:GetService("RunService").RenderStepped:wait()
- end
- end
- end
- script.Parent.HideBar.Leaderboard.MouseButton1Click:connect(function()
- if openedframe == "LB" then
- script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = ""
- elseif openedframe == "" then
- script.Parent.Leaderboard:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- openedframe = "LB"
- UpdateLeaderboard()
- end
- end)
- script.Parent.Leaderboard.Exit.MouseButton1Click:connect(function()
- script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- if openedframe == "LB" then
- openedframe = ""
- end
- end)
- -- PlrIB
- local PlrIBInfos = {}
- PlrIBInfos["SetText"] = {}
- PlrIBInfos["SetTextColor"] = {}
- if game.Players.LocalPlayer:IsInGroup(2586091) then
- if game.Players.LocalPlayer:GetRankInGroup(2586091) >= 253 then
- table.insert(PlrIBInfos["SetTextColor"], {Name = "Rank", Color = Color3.new(190/255, 23/255, 1/255)})
- elseif game.Players.LocalPlayer:GetRankInGroup(2586091) >= 250 then
- table.insert(PlrIBInfos["SetTextColor"], {Name = "Rank", Color = Color3.new(62/255, 36/255, 167/255)})
- else
- table.insert(PlrIBInfos["SetTextColor"], {Name = "Rank", Color = Color3.new(25/255, 255/255, 25/255)})
- end
- table.insert(PlrIBInfos["SetText"], {Name = "Rank", Text = "[ " .. game.Players.LocalPlayer:GetRoleInGroup(2586091) .. " ]"})
- else
- table.insert(PlrIBInfos["SetText"], {Name = "Rank", Text = ""})
- end
- if not CallServer("NPlrIB", true, PlrIBInfos) then print("CAN'T SENT BILLBOARD GUI!") end
- spawn(function()
- while true do
- if game.Players.LocalPlayer.Character ~= nil then
- if game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
- local char = game.Players.LocalPlayer.Character
- local hp = char.Humanoid.Health
- local maxhp = char.Humanoid.MaxHealth
- if 0.55 * (hp / maxhp) > 0.08 then
- if not ib:FindFirstChild("HP") then break end
- ib.HP:TweenSize(UDim2.new(0.55 * (hp / maxhp), 0, -0.15, 0), "Out", "Quad", 1, true)
- else
- if not ib:FindFirstChild("HP") then break end
- ib.HP:TweenSize(UDim2.new(0.08, 0, -0.15, 0), "Out", "Quad", 1, true)
- end
- if not ib:FindFirstChild("HPText") then break end
- ib.HPText.Text = "HP "..tostring(hp).."/"..tostring(maxhp)
- local xp = Stats.GetStat("XP")
- local lvl = CallServer("GetLVL")
- if not ib:FindFirstChild("XPText") then break end
- if lvl ~= 100 then
- if not ib:FindFirstChild("XPText") then break end
- ib.XPText.Text = "XP "..tostring(xp).."/"..tostring(lvl * 2)
- if 0.55 * (xp / (lvl * 2)) > 0.04 then
- if not ib:FindFirstChild("XP") then break end
- ib.XP:TweenSize(UDim2.new(0.55 * (xp / (lvl * 2)), 0, -0.15, 0), "Out", "Quad", 1, true)
- else
- if not ib:FindFirstChild("XP") then break end
- ib.XP:TweenSize(UDim2.new(0.04, 0, -0.15, 0), "Out", "Quad", 1, true)
- end
- else
- if not ib:FindFirstChild("XPText") then break end
- ib.XPText.Text = "Full level reached"
- if not ib:FindFirstChild("XP") then break end
- ib.XP:TweenSize(UDim2.new(0.55, 0, -0.15, 0), "Out", "Quad", 1, true)
- end
- if not ib:FindFirstChild("Level") then break end
- if not ib:FindFirstChild("Cash") then break end
- if not ib:FindFirstChild("BP") then break end
- if not ib:FindFirstChild("PB") then break end
- ib.Level.Text = "LVL " .. lvl
- ib.Cash.Text = Stats.GetStat("Cash") .. " PD"
- ib.PB.Text = Stats.GetStat("PokeBux") .. " PB"
- ib.BP.Text = Stats.GetStat("BP") .. " BP"
- -- PlrIB
- local PlrIBInfos = {}
- PlrIBInfos["SetText"] = {}
- PlrIBInfos["TweenSize"] = {}
- table.insert(PlrIBInfos["SetText"], {Name = "HPText", Text = "HP "..tostring(hp).."/"..tostring(maxhp)})
- if 1 * (hp / maxhp) > 0.08 then
- CallServer("PlrIB_TweenSize", "HP", UDim2.new(1 * (hp / maxhp), 0, 0.25, 0))
- else
- CallServer("PlrIB_TweenSize", "HP", UDim2.new(0.08, 0, 0.25, 0))
- end
- local cpvp = Stats.GetStat("PvP")
- if cpvp == 1 then
- if pvp == 0 then
- pvp = 1
- script.Parent.HideBar.PvP.Text = "Disable PvP"
- end
- table.insert(PlrIBInfos["SetText"], {Name = "PvP", Text = "[PVP]"})
- else
- if pvp == 1 then
- pvp = 0
- script.Parent.HideBar.PvP.Text = "Enable PvP"
- end
- table.insert(PlrIBInfos["SetText"], {Name = "PvP", Text = ""})
- end
- table.insert(PlrIBInfos["SetText"], {Name = "PlrName", Text = game.Players.LocalPlayer.Name .. " (Level "..lvl..")"})
- CallServer("NPlrIB", false, PlrIBInfos)
- HasEggTracker = Stats.GetStat("EggTracker") == 1
- end
- end
- wait()
- end
- end)
- function event.OnClientInvoke(...)
- local args = {...}
- if args[1] == "SHOP" then
- if openedframe ~= "TRADE" then
- if args[2] == "OPEN" then
- script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- if game.Players.LocalPlayer.Character then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = true
- end
- end
- openedframe = "SHOP"
- script.Parent.Shop:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- SetupShop(args[3])
- elseif args[2] == "CLOSE" then
- if openedframe == "SHOP" then
- openedframe = ""
- if game.Players.LocalPlayer.Character then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = false
- end
- end
- script.Parent.Shop:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- end
- end
- end
- elseif args[1] == "QUESTS" then
- if openedframe ~= "TRADE" then
- if args[2] == "OPEN" then
- script.Parent.Evolves:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Inventory:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Leaderboard:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- script.Parent.Shop:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- if game.Players.LocalPlayer.Character then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = true
- end
- end
- openedframe = "QUESTS"
- script.Parent.Quests:TweenPosition(UDim2.new(0.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- SetupQuest(args[3])
- elseif args[2] == "CLOSE" then
- if openedframe == "QUESTS" then
- openedframe = ""
- if game.Players.LocalPlayer.Character then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = false
- end
- end
- script.Parent.Quests:TweenPosition(UDim2.new(1.5, 0, 0.1, 0), "Out", "Quad", 1, true)
- end
- end
- end
- elseif args[1] == "ShowReward" then
- game.Players.LocalPlayer.PlayerGui.ShowReward.Value = args[2]
- elseif args[1] == "ClearRBXLInventory" then
- for _, i in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
- if i:IsA'Tool' or i:IsA'HopperBin' then
- i:Destroy()
- end
- end
- for _, i in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
- if i:IsA'Tool' or i:IsA'HopperBin' then
- i:Destroy()
- end
- end
- elseif args[1] == "TradePending" then
- Trade_Pending(args[2])
- elseif args[1] == "TradeStarted" then
- Trade_Started(args[2])
- elseif args[1] == "TradeChanged" then
- Trade_Changed(args[2])
- elseif args[1] == "TradeEnded" then
- Trade_Ended(args[2])
- elseif args[1] == "BattlePending" then
- local responded = false
- local function Respond(state)
- if not responded then
- responded = true
- CallServer("Battle", "Respond", args[2], state)
- end
- end
- if CheckAcceptionSupport() then
- local currentacceptationid = AddOnAcception(
- function(state)
- Respond(state)
- return "Successfuly "..(state and "accepted" or "declined").." the request!"
- end,
- "You have received trade request from "..args[2]
- )
- wait(16)
- if accfuncid == currentacceptationid then
- ResetOnAcceptation()
- end
- Respond(false)
- else
- local callback = Instance.new("BindableFunction")
- callback.Parent = script
- callback.Name = "BattleCallback"
- callback.OnInvoke = function(answer)
- local accepted = answer == "Accept"
- Respond(accepted)
- end
- game.StarterGui:SetCore("SendNotification", {
- Title = "Battle request",
- Text = "You have received battle request from "..args[2],
- Icon = "",
- Duration = 10,
- Callback = callback,
- Button1 = "Accept",
- Button2 = "Decline"
- })
- wait(11)
- Respond(false)
- end
- elseif args[1] == "BossFightLeaveNotification" then
- local responded = false
- local function Respond(state)
- if not responded then
- responded = true
- CallServer("BossFightLeaveRespond", state, args[2])
- end
- end
- if CheckAcceptionSupport() then
- local currentacceptationid = AddOnAcception(
- function(state)
- Respond(state)
- return "Successfuly "..(state and "accepted" or "declined").." the request!"
- end,
- "Do you really want to leave the boss fight?"
- )
- wait(16)
- if accfuncid == currentacceptationid then
- ResetOnAcceptation()
- end
- Respond(false)
- else
- local callback = Instance.new("BindableFunction")
- callback.Parent = script
- callback.Name = "BossFightLeaveCallback"
- callback.OnInvoke = function(answer)
- local accepted = answer == "Accept"
- Respond(accepted)
- end
- game.StarterGui:SetCore("SendNotification", {
- Title = "Boss fight",
- Text = "Do you really want to leave the boss fight?",
- Icon = "",
- Duration = 10,
- Callback = callback,
- Button1 = "Accept",
- Button2 = "Decline"
- })
- wait(11)
- Respond(false)
- end
- elseif args[1] == "BattleNotification" then
- game.StarterGui:SetCore("SendNotification", {
- Title = "Battle request",
- Text = args[2],
- Icon = "",
- Duration = 5,
- })
- elseif args[1] == "ACCEPTION" then
- return OnAccepted(args[2])
- end
- end
- end
- function OpenCGui()
- local curpokemon = nil
- local curcategory = nil
- local introf = gui.Intro
- introf.Visible = true
- local canusep = false
- -- Prepare pokemon :D
- local function View3D(model)
- -- 3D View
- local active = true
- 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)
- local Mod = require(script["3DModule"])
- local Model3D = Mod:Attach3D(gui["3DView"].Holder, model)
- Model3D:SetActive(true)
- game:GetService("RunService").RenderStepped:connect(function()
- if active then
- local fullrot = math.pi * 2
- local currot = tick()%fullrot
- Model3D:SetCFrame(CFrame.Angles(0, currot, 0))
- end
- end)
- game.Workspace.CurrentCamera.CameraType = "Scriptable"
- game.Workspace.CurrentCamera.CoordinateFrame = CameraCFrame
- game.Workspace.CurrentCamera.Focus = Model3D.Object3D:GetChildren()[1].CFrame
- introf:TweenPosition(UDim2.new(0, 0, -3, 0), "Out", "Quad", 1, true)
- return function()
- introf:TweenPosition(UDim2.new(0, 0, -1, 0), "Out", "Quad", 1, true, function()
- active = false
- game.Workspace.CurrentCamera.CameraType = "Custom"
- game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
- Model3D:SetActive(false)
- Model3D:End()
- end)
- end
- end
- local function ChoosePokemon(to, name, canuse)
- canusep = canuse
- local datas = script.Pokemon[to][name]
- curpokemon = name
- if canuse == true then
- introf.Informations.Image.Image = "rbxassetid://"..datas.ImageId.Value
- introf.Informations.Image.ImageColor3 = Color3.new(1,1,1)
- local lvl = CallServer("GetStat", datas.Stat.Value)
- if lvl then introf.Informations.Image.LVL.Text = "Level "..lvl end
- else
- introf.Informations.Image.Image = "rbxassetid://"..datas.ImageId.Value
- introf.Informations.Image.ImageColor3 = Color3.new(0,0,0)
- introf.Informations.Image.LVL.Text = ""
- end
- PokemonDatas = {}
- PokemonDatas.Category = to
- PokemonDatas.PokemonName = name
- introf.Informations.Image.Block.Visible = false
- introf.Informations:FindFirstChild("Name").Text = canuse and datas.Name or ""
- end
- local pokes = require(script.Pokemon.Sorter)
- local debounce = false
- local function ChangePokemonCategory(to)
- if debounce == false then
- debounce = true
- for _, i in pairs(introf.Choose.Pokemon:GetChildren()) do
- i:Destroy()
- end
- local YY = math.floor(#pokes[to] / 6)
- if #pokes[to] % 6 ~= 0 then
- YY = YY + 1
- end
- local YC = 1 / YY
- if YY <= 5 then
- YC = 0.2
- end
- local pcur = 1
- for id, name in pairs(pokes[to]) do
- local i = script.Pokemon[to]:FindFirstChild(name)
- local num = pcur
- num = num - 1
- local position = num % 6
- 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)
- local Button = Instance.new("ImageButton")
- Button.BackgroundTransparency = 1
- Button.Name = i.Name
- local canuse = false
- local Text = Instance.new("TextLabel")
- Text.BackgroundTransparency = 1
- Text.Name = i.Name
- Text.Text = ""
- Text.Size = UDim2.new(0.1, 0, YC / 4, 0)
- Text.TextScaled = false
- Text.ZIndex = 8
- Text.Parent = introf.Choose.Pokemon
- Text.Position = UDim2.new((((position) * 1.5)/10) + 0.05, 0, (line * YC) + (YC / 4) + (YC / 2), 0)
- Text.TextColor3 = Color3.new(0, 0, 0)
- Text.Font = Enum.Font.ArialBold
- Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
- Button.ImageColor3 = Color3.new(0,0,0)
- if i.Stat.Value == "" then
- canuse = true
- Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
- Button.ImageColor3 = Color3.new(1,1,1)
- Text.Text = i.Name
- elseif string.sub(i.Stat.Value, 1, 5) == "BADGE" then
- if CallServer("UserHasBadge", tonumber(string.sub(i.Stat.Value, 7))) then
- canuse = true
- Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
- Button.ImageColor3 = Color3.new(1,1,1)
- Text.Text = i.Name
- end
- elseif string.sub(i.Stat.Value, 1, 2) == "GP" then
- if CallServer("UserHasGamepass", tonumber(string.sub(i.Stat.Value, 4))) then
- canuse = true
- Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
- Button.ImageColor3 = Color3.new(1,1,1)
- Text.Text = i.Name
- end
- elseif string.sub(i.Stat.Value, 1, 5) == "GROUP" then
- if CallServer("IsInGroup", tonumber(string.sub(i.Stat.Value, 7))) then
- canuse = true
- Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
- Button.ImageColor3 = Color3.new(1,1,1)
- Text.Text = i.Name
- end
- else
- local curstat = Stats.GetStat(i.Stat.Value)
- if curstat and curstat ~= 0 then
- Button.Image = "rbxassetid://"..tostring(i.ImageId.Value)
- Button.ImageColor3 = Color3.new(1,1,1)
- canuse = true
- Text.Text = i.Name
- end
- end
- Button.Size = UDim2.new(0.1, 0, YC / 2, 0)
- Button.Position = UDim2.new((((position) * 1.5)/10) + 0.05, 0, (line * YC) + (YC / 4), 0)
- Button.Parent = introf.Choose.Pokemon
- Button.ZIndex = 8
- Button.MouseButton1Click:connect(function() ChoosePokemon(to, i.Name, canuse) end)
- if ((line + 1) * 0.2) < 1 then
- introf.Choose.Pokemon.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- introf.Choose.Pokemon.CanvasSize = UDim2.new(0, 0, ((line + 1) * 0.2), 0)
- end
- pcur = pcur + 1
- end
- curcategory = to
- debounce = false
- end
- end
- local minimalcanvasyscale = 1
- local allnum = 0
- for num in pairs(script.Pokemon:GetChildren()) do
- if num > allnum then
- allnum = num
- end
- end
- local YC = 1 / #script.Pokemon:GetChildren()
- if #script.Pokemon:GetChildren() <= 5 then
- YC = 0.2
- end
- for num = 1, #script.Pokemon:GetChildren(), 1 do
- for _, i in pairs(script.Pokemon:GetChildren()) do
- if string.sub(i.Name, 1, 2) == tostring(num + 10) then
- local button = Instance.new("TextButton")
- button.BackgroundTransparency = 1
- button.Position = UDim2.new(0, 0, (num - 1) * YC, 0)
- button.Size = UDim2.new(1, 0, YC, 0)
- button.Text = string.sub(i.Name, 3)
- button.Name = i.Name
- button.MouseButton1Click:connect(function() ChangePokemonCategory(i.Name) end)
- button.ZIndex = 8
- button.Parent = introf.Choose.Categories
- button.Font = Enum.Font.Creepster
- button.TextScaled = true
- button.TextColor3 = Color3.new(0, 0, 0)
- if num * YC < 1 then
- introf.Choose.Categories.CanvasSize = UDim2.new(0,0,0,0)
- else
- introf.Choose.Categories.CanvasSize = UDim2.new(0,0, num * YC, 0)
- end
- end
- end
- end
- 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)
- local play = "play"
- local choosenevolve = nil
- introf.Informations.Play.MouseButton1Click:connect(function()
- if play == "play" then
- if canusep and curpokemon ~= nil and curcategory ~= nil then
- introf.Choose:TweenPosition(UDim2.new(-1, 0, 0.54, 0), "Out", "Quad", 1, true)
- introf.Informations.Play:TweenPosition(UDim2.new(2, 0, 0.8, 0), "Out", "Quad", 1, true)
- wait(1)
- local textlabel = Instance.new("TextLabel", introf.Play)
- textlabel.TextColor3 = Color3.new(0,0,0)
- textlabel.BackgroundTransparency = 1
- textlabel.Position = UDim2.new(0,0,0,0)
- textlabel.Size = UDim2.new(1, 0, 0.8, 0)
- textlabel.TextScaled = true
- textlabel.Text = "Needs: \n"
- textlabel.TextYAlignment = "Top"
- textlabel.TextXAlignment = "Center"
- textlabel.ZIndex = 10
- local decoded = nil
- if script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]:FindFirstChild("Need") then
- decoded = mod(script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName].Need.Value)
- end
- if decoded ~= nil then
- for _, i in pairs(decoded) do
- if i[1] == "LVL" then
- textlabel.Text = textlabel.Text .. "Level " .. i[2]
- elseif i[1] == "C" then
- for id, v in pairs(mod2(i[2])) do
- if id ~= 1 then
- textlabel.Text = textlabel.Text .. " or "
- end
- textlabel.Text = textlabel.Text .. v .. " x" .. i[3]
- end
- elseif i[1] == "T" then
- for id, v in pairs(mod2(i[2])) do
- if id ~= 1 then
- textlabel.Text = textlabel.Text .. " or "
- end
- textlabel.Text = textlabel.Text .. v .. " x" .. i[3]
- end
- textlabel.Text = textlabel.Text .. " (will be taken)"
- elseif i[1] == "DAY" then
- textlabel.Text = textlabel.Text .. "Day needed"
- elseif i[1] == "NIGHT" then
- textlabel.Text = textlabel.Text .. "Night needed"
- end
- textlabel.Text = textlabel.Text .. "\n"
- end
- else
- textlabel.Text = textlabel.Text .. "No needs"
- end
- introf.Play:TweenPosition(UDim2.new(0.02, 0, 0.54, 0), "Out", "Quad", 1, true)
- introf.Informations.Play.Text = "Back"
- introf.Informations.Pokedex.Text = "Spawn"
- introf.Informations.Pokedex:TweenPosition(UDim2.new(0, 0, 0.64, 0), "Out", "Quad", 1, true)
- introf.Informations.Play:TweenPosition(UDim2.new(0, 0, 0.8, 0), "Out", "Quad", 1, true)
- play = "backchoosing"
- end
- elseif play == "backchoosing" then
- introf.Play:TweenPosition(UDim2.new(-1, 0, 0.54, 0), "Out", "Quad", 1, true)
- introf.Informations.Play:TweenPosition(UDim2.new(2, 0, 0.8, 0), "Out", "Quad", 1, true)
- introf.Informations.Pokedex:TweenPosition(UDim2.new(2, 0, 0.64, 0), "Out", "Quad", 1, true)
- wait(1)
- for _, i in pairs(introf.Play:GetChildren()) do
- i:Destroy()
- end
- introf.Choose:TweenPosition(UDim2.new(0.02, 0, 0.54, 0), "Out", "Quad", 1, true)
- introf.Informations.Play.Text = "Next"
- introf.Informations.Pokedex.Text = ""
- introf.Informations.Play:TweenPosition(UDim2.new(0, 0, 0.8, 0), "Out", "Quad", 1, true)
- play = "play"
- end
- end)
- local spawndebounce = false
- introf.Informations.Pokedex.MouseButton1Click:connect(function()
- if play == "backchoosing" then
- if spawndebounce == false then
- spawndebounce = true
- if canusep then
- local decoded = nil
- local requirementspass = true -- TO CHANGE
- if script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]:FindFirstChild("Need") then
- decoded = mod(script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName].Need.Value)
- end
- local stat = script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]:FindFirstChild("Stat")
- if decoded ~= nil then
- for _, i in pairs(decoded) do
- if i[1] == "LVL" then
- if stat then
- if CallServer("GetLVL", stat.Value) < tonumber(i[2]) then
- requirementspass = false
- end
- end
- elseif i[1] == "C" then
- local passed = false
- for id, v in pairs(mod2(i[2])) do
- if Stats.GetStat(v) >= tonumber(i[3]) then
- passed = true
- end
- end
- if not passed then requirementspass = false end
- elseif i[1] == "T" then
- local passed = false
- for id, v in pairs(mod2(i[2])) do
- if Stats.GetStat(v) >= tonumber(i[3]) then
- passed = true
- end
- end
- if not passed then requirementspass = false end
- elseif i[1] == "DAY" then
- if CallServer("DayNight") ~= "D" then
- requirementspass = false
- end
- elseif i[1] == "NIGHT" then
- if CallServer("DayNight") ~= "N" then
- requirementspass = false
- end
- end
- end
- end
- -- CHECKING REQUIREMENTS
- if requirementspass then
- -- CHOOSING SPAWN LOCATION
- local continue = false
- local sc = script.Parent.SpawnChoosing
- for _, i in pairs(game.Workspace.CurrentCamera:GetChildren()) do
- if i:IsA'BlurEffect' then
- i:Destroy()
- end
- end
- local cam = game.Workspace.CurrentCamera
- local lastcampos = cam.CFrame
- local blur = Instance.new("BlurEffect")
- blur.Size = 0
- blur.Parent = cam
- function round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- sc:TweenPosition(UDim2.new(0.2, 0, 0.7, 0), "Out", "Quad", 1, true)
- introf:TweenPosition(UDim2.new(0, 0, -3, 0), "Out", "Quad", 1, true, function() introf:Destroy() end)
- local ccamera = game.Workspace.CurrentCamera
- local datas = script.Pokemon[PokemonDatas.Category][PokemonDatas.PokemonName]
- ccamera.CameraType = "Scriptable"
- local spawns = {}
- local spawnscframes
- repeat wait() spawnscframes = CallServer("GetSpawns") until spawnscframes
- for i, _ in pairs(spawnscframes) do
- spawns[i] = i
- end
- local current = 1
- ccamera.CoordinateFrame = CFrame.new((spawnscframes[spawns[current]] * CFrame.new(0, 15, 15)).p, spawnscframes[spawns[current]].p)
- local lasti = 0
- local debounce = true
- local function SPAWN()
- if game.Players.LocalPlayer.Character ~= nil then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = false
- end
- end
- blur:Destroy()
- sc:TweenPosition(UDim2.new(0.2, 0, 1.5, 0), "Out", "Quad", 1, true)
- local old = ccamera.CoordinateFrame
- ccamera.CameraType = "Custom"
- spawn(function()
- for i = 1, 25, 1 do
- ccamera.CameraType = "Custom"
- wait(0.1)
- end
- end)
- ccamera.CoordinateFrame = old
- local response = CallServer("SpawnPokemon", PokemonDatas, spawns[current])
- if response then
- -- TAKE REQUIRED ITEMS
- if decoded ~= nil then
- for _, i in pairs(decoded) do
- if i[1] == "T" then
- for id, v in pairs(mod2(i[2])) do
- if Stats.GetStat(v) >= tonumber(i[3]) then
- CallServer("ChangeStat", v, Stats.GetStat(v) - tonumber(i[3]))
- break
- end
- end
- end
- end
- end
- local ef, hb, ib = script.Parent.Expand, script.Parent.HideBar, script.Parent.InfoBar
- ef.Visible = true
- hb.Visible = true
- ib.Visible = true
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
- game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
- if CallServer("GetStat", "KeepPvP") == 1 then
- CallServer("ChangeStat", "PvP", 1)
- else
- CallServer("ChangeStat", "PvP", 0)
- end
- gui.ChatFrame.LocalChatScript.Disabled = false
- script.Parent.InfoBar:FindFirstChild("Name").Text = curpokemon
- game:GetService("UserInputService").ModalEnabled = false
- spawn(function() SetupHUD(curcategory, curpokemon) end)
- local Shown = 0
- repeat
- Shown = 0
- if mobileinterface then
- ef:TweenPosition(UDim2.new(0.29, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
- hb:TweenPosition(UDim2.new(0.05, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
- ib:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
- else
- ef:TweenPosition(UDim2.new(0.18, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
- hb:TweenPosition(UDim2.new(0.04, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
- ib:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 1, true, function() Shown = Shown + 1 end)
- end
- wait(1.2)
- until Shown == 3
- else
- if game.Players.LocalPlayer.Character ~= nil then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = true
- end
- end
- spawndebounce = false
- end
- end
- function LOAD(prev)
- debounce = false
- local this = current
- local startcframe = game.Workspace.CurrentCamera.CoordinateFrame
- local startfocus = spawnscframes[spawns[prev]]
- if game.Players.LocalPlayer.Character ~= nil then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- game.Players.LocalPlayer.Character.Torso.Anchored = true
- end
- end
- for i = 1, 60 do
- game.Workspace.CurrentCamera.CameraType = "Scriptable"
- 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))
- if game.Players.LocalPlayer.Character ~= nil then
- if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then
- local camX, camY, camZ = game.Workspace.CurrentCamera.CoordinateFrame.X, game.Workspace.CurrentCamera.CoordinateFrame.Y, game.Workspace.CurrentCamera.CoordinateFrame.Z
- game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(camX, camY, camZ) * CFrame.new(0, -100, 0)
- end
- end
- game:GetService("RunService").RenderStepped:wait()
- end
- debounce = true
- while this == current and not continue do
- if lasti > 359.5 then lasti = 0 end
- for i = lasti, 360, 0.5 do
- lasti = i
- game.Workspace.CurrentCamera.CameraType = "Scriptable"
- 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)
- if current ~= this or continue then
- break
- end
- local cx, cy, cz = cam.CFrame:toEulerAnglesXYZ()
- local lx, ly, lz = lastcampos:toEulerAnglesXYZ()
- local camdist = (
- -- it needs to be rounded this way because of strange floating point
- -- errors that happen with the camera facing directly up or down
- Vector3.new(round(cx,2),round(cy,2),round(cz,2)) -
- Vector3.new(round(lx,2),round(ly,2),round(lz,2))
- ).magnitude
- blur.Size = camdist * 10
- lastcampos = cam.CFrame
- wait(1/60)
- end
- end
- end
- spawn(function()
- sc.Previous.MouseButton1Click:connect(function()
- if debounce then
- local prev = current
- current = current - 1
- if current == 0 then current = #spawns end
- LOAD(prev)
- end
- end)
- sc.Next.MouseButton1Click:connect(function()
- if debounce then
- local prev = current
- current = current + 1
- if current == #spawns + 1 then current = 1 end
- LOAD(prev)
- end
- end)
- end)
- sc.Spawn.MouseButton1Click:connect(function()
- if debounce then
- debounce = false
- continue = true
- SPAWN()
- end
- end)
- LOAD(current)
- else
- spawndebounce = false
- end
- else
- spawndebounce = false
- end
- end
- end
- end)
- introf.Informations.Image["3DView"].MouseButton1Click:connect(function()
- if canusep == true then
- local pokemon = CallServer("Get3DPokemon", curpokemon)
- if pokemon ~= nil then
- local turnofffunc = View3D(pokemon)
- local turnoffbutton = Instance.new("TextButton", script.Parent)
- turnoffbutton.Text = "Back"
- turnoffbutton.BackgroundTransparency = 1
- turnoffbutton.Font = Enum.Font.ArialBold
- turnoffbutton.TextScaled = true
- turnoffbutton.TextColor3 = Color3.new(0, 0, 0)
- turnoffbutton.Size = UDim2.new(0.3, 0, 0.25, 0)
- turnoffbutton.Position = UDim2.new(-0.5, 0, 0.7, 0)
- turnoffbutton:TweenPosition(UDim2.new(0.05, 0, 0.7, 0), "Out", "Quad", 1, true)
- turnoffbutton.MouseButton1Click:connect(function()
- turnoffbutton:TweenPosition(UDim2.new(-0.5, 0, 0.7, 0), "Out", "Quad", 1, true, function()
- turnoffbutton:Destroy()
- pokemon:Destroy()
- end)
- turnofffunc()
- end)
- turnoffbutton.Name = "TurnOff3DView"
- end
- end
- end)
- introf.Choose:TweenPosition(UDim2.new(0.02, 0, 0.54, 0), "Out", "Quad", 1, true)
- introf.Informations:TweenPosition(UDim2.new(0.61, 0, 0.54, 0), "Out", "Quad", 1, true)
- end
- function SetupSGui()
- local SButtonsDebounce = false
- gui.Intro.Visible = true
- local function SetupOThings()
- -- Choosing menu
- OpenCGui()
- end
- local run = true
- local Img = Instance.new("ImageLabel", gui)
- Img.Name = "MenuImage"
- Img.BackgroundTransparency = 1
- if ReturnConf("MenuImages")[1] then Img.Image = ReturnConf("MenuImages")[1] end
- Img.Size = UDim2.new(0.6, 0, 0.3, 0)
- Img.Position = UDim2.new(0.2, 0, -2, 0)
- Img:TweenPosition(UDim2.new(0.2, 0, 0.15, 0), "Out", "Quad", 1, true)
- Img.ZIndex = 6
- local buttons = {} -- Buttons Holder
- -- Play
- buttons.Play = Instance.new("TextButton", gui)
- buttons.Play.BackgroundTransparency = 1
- buttons.Play.Name = "Play"
- buttons.Play.TextScaled = true
- buttons.Play.TextColor3 = Color3.new(255, 255, 255)
- buttons.Play.TextStrokeColor3 = Color3.new(0, 0, 0)
- buttons.Play.TextStrokeTransparency = 0
- buttons.Play.Font = Enum.Font.ArialBold
- buttons.Play.Text = "Play"
- buttons.Play.ZIndex = 6
- buttons.Play.Position = UDim2.new(0.4, 0, 1.5, 0)
- buttons.Play.Size = UDim2.new(0.2, 0, 0.1, 0)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
- -- Settings
- buttons.Settings = Instance.new("TextButton", gui)
- buttons.Settings.BackgroundTransparency = 1
- buttons.Settings.Name = "Settings"
- buttons.Settings.TextScaled = true
- buttons.Settings.TextColor3 = Color3.new(255, 255, 255)
- buttons.Settings.TextStrokeColor3 = Color3.new(0, 0, 0)
- buttons.Settings.TextStrokeTransparency = 0
- buttons.Settings.Font = Enum.Font.ArialBold
- buttons.Settings.Text = "Settings"
- buttons.Settings.ZIndex = 6
- buttons.Settings.Position = UDim2.new(0.4, 0, 1.6, 0)
- buttons.Settings.Size = UDim2.new(0.2, 0, 0.1, 0)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
- -- Credits
- buttons.Credits = Instance.new("TextButton", gui)
- buttons.Credits.BackgroundTransparency = 1
- buttons.Credits.Name = "Credits"
- buttons.Credits.TextScaled = true
- buttons.Credits.TextColor3 = Color3.new(255, 255, 255)
- buttons.Credits.TextStrokeColor3 = Color3.new(0, 0, 0)
- buttons.Credits.TextStrokeTransparency = 0
- buttons.Credits.Font = Enum.Font.ArialBold
- buttons.Credits.Text = "Credits"
- buttons.Credits.ZIndex = 6
- buttons.Credits.Position = UDim2.new(0.4, 0, 1.7, 0)
- buttons.Credits.Size = UDim2.new(0.2, 0, 0.1, 0)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
- -- FAQ
- buttons.FAQ = Instance.new("TextButton", gui)
- buttons.FAQ.BackgroundTransparency = 1
- buttons.FAQ.Name = "FAQ"
- buttons.FAQ.TextScaled = true
- buttons.FAQ.TextColor3 = Color3.new(255, 255, 255)
- buttons.FAQ.TextStrokeColor3 = Color3.new(0, 0, 0)
- buttons.FAQ.TextStrokeTransparency = 0
- buttons.FAQ.Font = Enum.Font.ArialBold
- buttons.FAQ.Text = "FAQ"
- buttons.FAQ.ZIndex = 6
- buttons.FAQ.Position = UDim2.new(0.4, 0, 1.8, 0)
- buttons.FAQ.Size = UDim2.new(0.2, 0, 0.1, 0)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
- buttons.Play.MouseButton1Click:connect(function()
- if SButtonsDebounce then return end
- SButtonsDebounce = true
- run = false
- Anim2Running = false
- Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
- wait(1)
- buttons.Play:Destroy()
- Img:Destroy()
- SetupOThings()
- end)
- local function RunAnim()
- if ReturnConf("MenuImages")[1] then
- local currentimg = 1
- run = true
- spawn(function()
- while run do
- wait(0.1)
- for i = 1, 5, 1 do
- if not run or Img == nil then
- break
- end
- Img:TweenSizeAndPosition(UDim2.new(0.7, 0, 0.34, 0), UDim2.new(0.15, 0, 0.13, 0), "Out", "Quad", 2, true)
- wait(3)
- if not run or Img == nil then
- break
- end
- Img:TweenSizeAndPosition(UDim2.new(0.6, 0, 0.3, 0), UDim2.new(0.2, 0, 0.15, 0), "Out", "Quad", 2, true)
- wait(3)
- end
- if Img == nil then
- break
- end
- for i = 0, 1, 0.1 do
- if not run or Img == nil then
- break
- end
- Img.ImageTransparency = i
- wait(0.1)
- end
- if not run or Img == nil then
- break
- end
- if #ReturnConf("MenuImages") == currentimg then
- Img.Image = ReturnConf("MenuImages")[1]
- else
- Img.Image = ReturnConf("MenuImages")[currentimg + 1]
- end
- for i = 1, 0, -0.1 do
- if not run or Img == nil then
- break
- end
- Img.ImageTransparency = i
- wait(0.1)
- end
- end
- for i = 1, 60, 1 do
- if not run or Img == nil then
- break
- end
- Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
- wait()
- end
- end)
- end
- end
- buttons.Credits.MouseButton1Click:connect(function()
- if SButtonsDebounce then return end
- SButtonsDebounce = true
- local getusernamefromid = require(script.GetUserNameFromId)
- run = false
- local y = 1 / #ReturnConf("Credits")
- if y > 0.3 then
- y = 0.3
- end
- for num, i in pairs(ReturnConf("Credits")) do
- local frametype = num % 2 == 1 and 1 or 2
- local frame = Instance.new("Frame", script.Parent.Credits.List)
- frame.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
- frame.Position = UDim2.new(0, 0, (num - 1) * y, 0)
- frame.Size = UDim2.new(1, 0, y, 0)
- frame.Name = tostring(num)
- frame.ZIndex = 9
- frame.BorderColor3 = Color3.new(0,0,0)
- frame.BorderSizePixel = 5
- local img = Instance.new("ImageLabel", frame)
- img.BackgroundTransparency = 0
- img.BackgroundColor3 = Color3.new(61/255, 61/255, 61/255)
- img.BorderSizePixel = 3
- img.BorderColor3 = Color3.new(0,0,0)
- img.Size = UDim2.new(0.3, 0, 0.8, 0)
- img.ZIndex = 10
- img.Image = "https://www.roblox.com/bust-thumbnail/image?userId="..i["ID"].."&width=420&height=420&format=png"
- local name = Instance.new("TextLabel", frame)
- name.BackgroundTransparency = 1
- name.TextScaled = true
- name.TextColor3 = Color3.new(1,1,1)
- name.Font = Enum.Font.SourceSansBold
- name.Text = "Loading username..." spawn(function() name.Text = getusernamefromid(tonumber(i["ID"])) end)
- name.Size = UDim2.new(0.65, 0, 0.2, 0)
- name.ZIndex = 10
- local rank = Instance.new("TextLabel", frame)
- rank.BackgroundTransparency = 1
- rank.TextScaled = true
- rank.TextColor3 = Color3.new(1,1,1)
- rank.Font = Enum.Font.Arcade
- rank.Text = i["Rank"]
- rank.Size = UDim2.new(0.65, 0, 0.2, 0)
- rank.ZIndex = 10
- local title = Instance.new("TextLabel", frame)
- title.BackgroundTransparency = 1
- title.TextScaled = true
- title.TextColor3 = Color3.new(1,1,1)
- title.Font = Enum.Font.Arcade
- title.Text = i["Title"]
- title.Size = UDim2.new(0.65, 0, 0.2, 0)
- title.ZIndex = 10
- if frametype == 1 then
- name.TextXAlignment = "Left"
- rank.TextXAlignment = "Left"
- title.TextXAlignment = "Left"
- img.Position = UDim2.new(0, 0, 0.1, 0)
- rank.Position = UDim2.new(0.35, 0, 0, 0)
- name.Position = UDim2.new(0.35, 0, 0.2, 0)
- title.Position = UDim2.new(0.35, 0, 0.7, 0)
- elseif frametype == 2 then
- name.TextXAlignment = "Right"
- rank.TextXAlignment = "Right"
- title.TextXAlignment = "Right"
- img.Position = UDim2.new(0.7, 0, 0.1, 0)
- rank.Position = UDim2.new(0, 0, 0, 0)
- name.Position = UDim2.new(0, 0, 0.2, 0)
- title.Position = UDim2.new(0, 0, 0.7, 0)
- end
- if 0.4 * num < 0.8 then
- script.Parent.Credits.List.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- script.Parent.Credits.List.CanvasSize = UDim2.new(0, 0, 0.4 * num, 0)
- end
- end
- Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
- wait(0.5)
- script.Parent.Credits:TweenPosition(UDim2.new(0.2, 0, 0.05, 0), "Out", "Quad", 1, true)
- end)
- script.Parent.Credits.Back.MouseButton1Click:connect(function()
- SButtonsDebounce = false
- script.Parent.Credits:TweenPosition(UDim2.new(0.2, 0, 1.5, 0), "Out", "Quad", 1, true)
- wait(0.5)
- for _, i in pairs(script.Parent.Credits.List:GetChildren()) do i:Destroy() end
- 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)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
- end)
- buttons.Settings.MouseButton1Click:connect(function()
- if SButtonsDebounce then return end
- SButtonsDebounce = true
- run = false
- local y = 1 / #ReturnConf("Settings")
- if y > 0.15 then
- y = 0.15
- end
- for num, i in pairs(ReturnConf("Settings")) do
- local holder = Instance.new("Frame", script.Parent.Settings.List)
- holder.BackgroundTransparency = 1
- holder.Size = UDim2.new(1, 0, y, 0)
- holder.Position = UDim2.new(0, 0, (num - 1) * y, 0)
- holder.ZIndex = 8
- local textlabel = Instance.new("TextLabel", holder)
- textlabel.BackgroundTransparency = 1
- textlabel.Size = UDim2.new(0.7, 0, 1, 0)
- textlabel.Position = UDim2.new(0,0,0,0)
- textlabel.TextScaled = true
- textlabel.Text = i["Name"]
- textlabel.ZIndex = 9
- textlabel.TextColor3 = Color3.new(1,1,1)
- local cur = Stats.GetStat(i["Stat"])
- local textbutton = Instance.new("TextButton", holder)
- textbutton.BackgroundTransparency = 1
- textbutton.Size = UDim2.new(0.3, 0, 1, 0)
- textbutton.Position = UDim2.new(0.7, 0, 0, 0)
- textbutton.TextScaled = true
- textbutton.Text = cur == 1 and "Enabled" or "Disabled"
- textbutton.ZIndex = 9
- textbutton.TextColor3 = cur == 1 and Color3.new(93/255, 204/255, 54/255) or Color3.new(1, 99/255, 93/255)
- textbutton.MouseButton1Click:connect(function()
- cur = 1 - cur
- CallServer("ChangeStat", i["Stat"], cur)
- textbutton.Text = cur == 1 and "Enabled" or "Disabled"
- textbutton.TextColor3 = cur == 1 and Color3.new(93/255, 204/255, 54/255) or Color3.new(1, 99/255, 93/255)
- end)
- if 0.2 * num < 0.59 then
- script.Parent.Settings.List.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- script.Parent.Settings.List.CanvasSize = UDim2.new(0, 0, 0.2 * num, 0)
- end
- end
- Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
- wait(0.5)
- script.Parent.Settings:TweenPosition(UDim2.new(0.2, 0, 0.05, 0), "Out", "Quad", 1, true)
- end)
- script.Parent.Settings.Back.MouseButton1Click:connect(function()
- SButtonsDebounce = false
- script.Parent.Settings:TweenPosition(UDim2.new(0.2, 0, 1.5, 0), "Out", "Quad", 1, true)
- wait(0.5)
- for _, i in pairs(script.Parent.Settings.List:GetChildren()) do i:Destroy() end
- 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)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
- end)
- script.Parent.Settings.Feedback.Send.MouseButton1Click:connect(function()
- if script.Parent.Settings.Feedback.TextBox.Text ~= "Feedback has been sent!" then
- CallServer("SendFeedback", script.Parent.Settings.Feedback.TextBox.Text)
- script.Parent.Settings.Feedback.TextBox.Text = "Feedback has been sent!"
- end
- end)
- buttons.FAQ.MouseButton1Click:connect(function()
- if SButtonsDebounce then return end
- SButtonsDebounce = true
- run = false
- local y = 1 / #ReturnConf("FAQ")
- if y > 0.1 then
- y = 0.1
- end
- for num, i in pairs(ReturnConf("FAQ")) do
- local holder = Instance.new("Frame", script.Parent.FAQ.List)
- holder.BackgroundTransparency = 1
- holder.Size = UDim2.new(1, 0, y - 0.015, 0)
- holder.Position = UDim2.new(0, 0, (num - 1) * y, 0)
- holder.ZIndex = 8
- local textlabel = Instance.new("TextLabel", holder)
- textlabel.BackgroundTransparency = 1
- textlabel.Size = UDim2.new(1, 0, 0.5, 0)
- textlabel.Position = UDim2.new(0,0,0,0)
- textlabel.TextScaled = true
- textlabel.Text = "Question No. "..tostring(num)..": "..i["Question"]
- textlabel.ZIndex = 9
- textlabel.TextColor3 = Color3.new(1,1,1)
- local textlabel = Instance.new("TextLabel", holder)
- textlabel.BackgroundTransparency = 1
- textlabel.Size = UDim2.new(1, 0, 0.5, 0)
- textlabel.Position = UDim2.new(0,0,0.5,0)
- textlabel.TextScaled = true
- textlabel.Text = "Answer: "..i["Answer"]
- textlabel.ZIndex = 9
- textlabel.TextColor3 = Color3.new(1,1,1)
- if 0.2 * num < 0.59 then
- script.Parent.FAQ.List.CanvasSize = UDim2.new(0, 0, 0, 0)
- else
- script.Parent.FAQ.List.CanvasSize = UDim2.new(0, 0, 0.2 * num, 0)
- end
- end
- Img:TweenPosition(UDim2.new(Img.Position.X.Scale, 0, -2, 0), "Out", "Quad", 1, true)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 1.5, 0), "Out", "Quad", 1, true)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 1.6, 0), "Out", "Quad", 1, true)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 1.7, 0), "Out", "Quad", 1, true)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 1.8, 0), "Out", "Quad", 1, true)
- wait(0.5)
- script.Parent.FAQ:TweenPosition(UDim2.new(0.1, 0, 0.05, 0), "Out", "Quad", 1, true)
- end)
- script.Parent.FAQ.Back.MouseButton1Click:connect(function()
- SButtonsDebounce = false
- script.Parent.FAQ:TweenPosition(UDim2.new(0.1, 0, 1.5, 0), "Out", "Quad", 1, true)
- wait(0.5)
- for _, i in pairs(script.Parent.FAQ.List:GetChildren()) do i:Destroy() end
- 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)
- buttons.Play:TweenPosition(UDim2.new(0.4, 0, 0.5, 0), "Out", "Quad", 1, true)
- buttons.Settings:TweenPosition(UDim2.new(0.4, 0, 0.6, 0), "Out", "Quad", 1, true)
- buttons.Credits:TweenPosition(UDim2.new(0.4, 0, 0.7, 0), "Out", "Quad", 1, true)
- buttons.FAQ:TweenPosition(UDim2.new(0.4, 0, 0.8, 0), "Out", "Quad", 1, true)
- end)
- wait(1)
- RunAnim()
- end
- SetupSGui()
Advertisement
Advertisement