Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- params : ...
- wait(1)
- Players = game:GetService("Players")
- Player = Players.LocalPlayer
- Replicated = game:GetService("ReplicatedStorage")
- Func = Replicated:WaitForChild("GMFunc")
- Event = Replicated:WaitForChild("GMEvent")
- Gui = script.Parent
- TabList = Gui.TabList
- Windows = Gui.Windows
- AlertPrompt = Gui.AlertPrompt
- BackgroundNormal = Color3.new(0.49803921568627, 0.74509803921569, 0.74509803921569)
- BackgroundSelected = Color3.new(1, 0.66666666666667, 0)
- PromptButtonBackgroundNormal = Color3.new(0.33725490196078, 0.50588235294118, 0.50588235294118)
- PromptButtonBackgroundSelected = BackgroundSelected
- Selected = {}
- MouseEnterEvents = {}
- MouseLeaveEvents = {}
- for _,v in pairs(Gui:children()) do
- do
- if v:IsA("Sound") then
- do
- game:service("ContentProvider"):Preload(v.SoundId)
- -- DECOMPILER ERROR at PC85: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC85: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- end
- ShowAlertPrompt = function(Title, Body, NoText, YesText, NoFunc, YesFunc)
- local Window = AlertPrompt.Window
- Window.Top.Title.Text = Title
- Window.Body.Text = Body
- Window.No.TextLabel.Text = NoText
- Window.Yes.TextLabel.Text = YesText
- if not MouseEnterEvents[Window.No] then
- MouseEnterEvents[Window.No] = Window.No.MouseEnter:connect(function()
- Window.No.BackgroundColor3 = PromptButtonBackgroundSelected
- Window.No.ImageColor3 = PromptButtonBackgroundSelected
- end)
- end
- if not MouseLeaveEvents[Window.No] then
- MouseLeaveEvents[Window.No] = Window.No.MouseLeave:connect(function()
- Window.No.BackgroundColor3 = PromptButtonBackgroundNormal
- Window.No.ImageColor3 = PromptButtonBackgroundNormal
- end)
- end
- if not MouseEnterEvents[Window.Yes] then
- MouseEnterEvents[Window.Yes] = Window.Yes.MouseEnter:connect(function()
- Window.Yes.BackgroundColor3 = PromptButtonBackgroundSelected
- Window.Yes.ImageColor3 = PromptButtonBackgroundSelected
- end)
- end
- if not MouseLeaveEvents[Window.Yes] then
- MouseLeaveEvents[Window.Yes] = Window.Yes.MouseLeave:connect(function()
- Window.Yes.BackgroundColor3 = PromptButtonBackgroundNormal
- Window.Yes.ImageColor3 = PromptButtonBackgroundNormal
- end)
- end
- Window.No.MouseButton1Click:connect(function()
- NoFunc()
- end)
- Window.Yes.MouseButton1Click:connect(function()
- YesFunc()
- end)
- Gui.Alert:Play()
- AlertPrompt.Visible = true
- end
- ClosePrompt = function(Base)
- local Window = Base.Window
- Base.Visible = false
- Window.No.BackgroundColor3 = PromptButtonBackgroundNormal
- Window.No.ImageColor3 = PromptButtonBackgroundNormal
- Window.Yes.BackgroundColor3 = PromptButtonBackgroundNormal
- Window.Yes.ImageColor3 = PromptButtonBackgroundNormal
- end
- for _,v in pairs(TabList:children()) do
- do
- Selected[v] = false
- v.MouseEnter:connect(function()
- v.BackgroundColor3 = BackgroundSelected
- v.ImageColor3 = BackgroundSelected
- end)
- v.MouseLeave:connect(function()
- if not Selected[v] then
- v.BackgroundColor3 = BackgroundNormal
- v.ImageColor3 = BackgroundNormal
- end
- end)
- v.MouseButton1Click:connect(function()
- Selected[v] = not Selected[v]
- Gui.Beep:Play()
- for _,x in pairs(TabList:children()) do
- if x.Name ~= v.Name then
- Selected[x] = false
- x.BackgroundColor3 = BackgroundNormal
- x.ImageColor3 = BackgroundNormal
- end
- end
- for _,x in pairs(Gui:children()) do
- if x:IsA("ScrollingFrame") and x ~= TabList and x.Name:find("TabList") and x.Name ~= "TabList" .. v.Name then
- x.Visible = false
- end
- end
- local Next = Gui["TabList" .. v.Name]
- Next.Visible = Selected[v]
- end)
- end
- end
- for _,h in pairs(Gui:children()) do
- if h:IsA("ScrollingFrame) and h ~= TabList and h.Name:find("TabList) then
- for _,v in pairs(h:children()) do
- if v.ClassName:find("Button") then
- Selected[v] = false
- v.MouseEnter:connect(function()
- v.BackgroundColor3 = BackgroundSelected
- v.ImageColor3 = BackgroundSelected
- end)
- v.MouseLeave:connect(function()
- if not Selected[v] then
- v.BackgroundColor3 = BackgroundNormal
- v.ImageColor3 = BackgroundNormal
- end
- end)
- v.MouseButton1Click:connect(function()
- Selected[v] = not Selected[v]
- for _,x in pairs(h:children()) do
- if x.Name ~= v.Name then
- Selected[x] = false
- x.BackgroundColor3 = BackgroundNormal
- x.ImageColor3 = BackgroundNormal
- end
- end
- if v.Name == "Logout" then
- ShowAlertPrompt("LOG OUT", "Logging out will terminate all services.", "Cancel", "Log Out", function()
- Gui.PromptClose:Play()
- ClosePrompt(AlertPrompt)
- Selected[v] = false
- v.BackgroundColor3 = BackgroundNormal
- v.ImageColor3 = BackgroundNormal
- end, function()
- Gui.PromptAccept:Play()
- Player:Kick("Cardinal // You have been logged out of Aincrad Online.")
- end)
- else
- if v.Name == "PlayerData" then
- Gui.Beep:Play()
- Windows.PlayerData.Visible = not Windows.PlayerData.Visible
- else
- if v.Name == "DataSpread" then
- Gui.Beep:Play()
- Windows.DataSpread.Visible = not Windows.DataSpread.Visible
- else
- Gui.Beep:Play()
- end
- end
- end
- end)
- end
- end
- end
- end
- local Window = Windows.PlayerData
- local Prompt = Window.Prompt
- local PromptWindow = Prompt.Window
- local Scroll = Window.DataScroll
- local PlayerName = Window.PlayerName
- local Close = PromptWindow.Top.Close
- Close.MouseButton1Click:connect(function()
- Gui.PromptClose:Play()
- Prompt.Visible = false
- end)
- local TextBox = PromptWindow.Input.TextBox
- TextBox.FocusLost:connect(function(Enter)
- if Enter then
- local Data = Func:InvokeServer("GetPlayerData", TextBox.Text)
- if not Data then
- Gui.Fail:Play()
- return
- end
- Gui.PromptAccept:Play()
- Prompt.Visible = false
- PlayerName.Text = TextBox.Text:upper()
- for _,v in pairs(Scroll:children()) do
- if v.Name ~= "Example" then
- v:Remove()
- end
- end
- local Index = 0
- for i,v in pairs(Data) do
- Index = Index + 1
- local Val = tostring(v)
- local New = Scroll.Example:Clone()
- New.Visible = true
- New.Name = Index
- New.Left.Text = i
- New.Right.Text = #Val > 30 and Val:sub(1, 27) .. "..." or Val
- New.Position = UDim2.new(0, 0, 0, Scroll.Example.Size.Y.Offset * (Index - 1))
- New.Parent = Scroll
- end
- Scroll.CanvasSize = UDim2.new(0, 0, 0, (Index) * Scroll.Example.Size.Y.Offset)
- end
- end)
- local Search = Window.Search
- Search.MouseEnter:connect(function()
- Search.Image = "rbxassetid://299627353"
- end)
- Search.MouseLeave:connect(function()
- Search.Image = "rbxassetid://299627334"
- end)
- Search.MouseButton1Click:connect(function()
- Prompt.Visible = true
- end)
- local Window = Windows.DataSpread
- local LevelGraph = Window.LevelGraph
- local ColGraph = Window.ColGraph
- local RefreshDeb = false
- UpdateSpreadGraphs = function(nosound)
- local Data = Func:InvokeServer("GetDataSpread")
- if not Data and not nosound then
- Gui.Fail:Play()
- end
- do return end
- if not nosound then
- Gui.PromptAccept:Play()
- end
- local TotalPlayers = 0
- local HighestLevel, HighestCol = 0, 0
- for _,v in pairs(Data) do
- local userId = v.key:match("%d+")
- local data = v.value
- if data then
- TotalPlayers = TotalPlayers + 1
- for _,sub in pairs(data) do
- local name = sub[1]
- local val = sub[2]
- if name == "Level" and HighestLevel == 0 then
- HighestLevel = val
- else
- if name == "Col" and HighestCol < val then
- HighestCol = val
- end
- end
- end
- end
- end
- local IncLevel = math.floor(HighestLevel / 6)
- local IncCol = math.floor(HighestCol / 6)
- local Prev1 = 0
- local Current1 = IncLevel
- local Prev2 = 0
- local Current2 = IncCol
- local Ranges1, Ranges2 = {}, {}
- for i = 1, 6 do
- local Frame1 = LevelGraph["Frame" .. i]
- local Frame2 = ColGraph["Frame" .. i]
- Frame1.Label.Text = Prev1 .. " - " .. Current1
- Frame2.Label.Text = Prev2 .. " - " .. Current2
- Ranges1[i] = {Prev1, Current1, 0}
- Ranges2[i] = {Prev2, Current2, 0}
- Prev1 = Prev1 + IncLevel + 1
- Current1 = Prev1 + IncLevel
- Prev2 = Prev2 + IncCol + 1
- Current2 = Prev2 + IncCol
- if i == 5 then
- Current1 = HighestLevel
- Current2 = HighestCol
- end
- end
- for _,v in pairs(Data) do
- local userId = v.key:match("%d+")
- local data = v.value
- if data then
- for _,sub in pairs(data) do
- local name = sub[1]
- local val = sub[2]
- local graph, ranges = nil, nil
- if name == "Level" then
- graph = Window.LevelGraph
- ranges = Ranges1
- else
- if name == "Col" then
- graph = Window.ColGraph
- ranges = Ranges2
- end
- end
- if graph and ranges then
- for num,range in pairs(ranges) do
- local min = range[1]
- local max = range[2]
- local total = range[3]
- if min <= val and val <= max then
- ranges[num] = {min, max, total + 1}
- break
- end
- end
- end
- end
- end
- end
- for num,range in pairs(Ranges1) do
- local min = range[1]
- local max = range[2]
- local total = range[3]
- LevelGraph["Frame" .. num].Bar:TweenSize((UDim2.new(math.max(total / (TotalPlayers) - 0.1, 0), 0, 1, 0)), nil, nil, 0.2, true)
- if total ~= 0 or not "" then
- do
- LevelGraph["Frame" .. num].Bar.Percent.Text = "~" .. math.floor(total / (TotalPlayers) * 100) .. "%"
- -- DECOMPILER ERROR at PC226: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC226: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- for num,range in pairs(Ranges2) do
- local min = range[1]
- local max = range[2]
- local total = range[3]
- ColGraph["Frame" .. num].Bar:TweenSize((UDim2.new(math.max(total / (TotalPlayers) - 0.1, 0), 0, 1, 0)), nil, nil, 0.2, true)
- if total ~= 0 or not "" then
- do
- ColGraph["Frame" .. num].Bar.Percent.Text = "~" .. math.floor(total / (TotalPlayers) * 100) .. "%"
- -- DECOMPILER ERROR at PC279: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC279: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- Window.Total.Text = TotalPlayers .. " players graphed"
- end
- Window.Refresh.MouseButton1Click:connect(function()
- if RefreshDeb then
- return
- end
- RefreshDeb = true
- Window.Total.Text = "Loading data..."
- for _,v in pairs(Window:children()) do
- if v.Name:find("Graph") and v:IsA("Frame") then
- for x = 1, 6 do
- v["Frame" .. x].Bar.Percent.Text = ""
- v["Frame" .. x].Bar:TweenSize((UDim2.new(0, 0, 1, 0)), nil, nil, 0.2, true)
- end
- end
- end
- UpdateSpreadGraphs()
- wait(3)
- RefreshDeb = false
- end)
- Window.ViewLevelGraph.MouseButton1Click:connect(function()
- do
- local View = "LevelGraph"
- for _,v in pairs(Window:children()) do
- if v.Name ~= View then
- do
- v.Visible = not v.Name:find("Graph") or not v:IsA("Frame")
- -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- Gui.PromptAccept:Play()
- -- DECOMPILER ERROR: 2 unprocessed JMP targets
- end
- end)
- Window.ViewColGraph.MouseButton1Click:connect(function()
- do
- local View = "ColGraph"
- for _,v in pairs(Window:children()) do
- if v.Name ~= View then
- do
- v.Visible = not v.Name:find("Graph") or not v:IsA("Frame")
- -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_THEN_STMT
- -- DECOMPILER ERROR at PC24: LeaveBlock: unexpected jumping out IF_STMT
- end
- end
- end
- Gui.PromptAccept:Play()
- -- DECOMPILER ERROR: 2 unprocessed JMP targets
- end
- end)
- UpdateSpreadGraphs(true)
- Event.OnClientEvent:connect(function(...)
- local Args = {...}
- if Args[1] == "UpdateSpreadGraphs" then
- UpdateSpreadGraphs(true)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement