Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Synapse Decompiler
- -- Purchase Here: https://brack4712.xyz/synapse/purchase/
- local Graph = script.Parent
- local Point = Graph:WaitForChild("Point"):Clone()
- local Loading = Graph:WaitForChild("Loading")
- local Title = Graph:WaitForChild("Title")
- local YLabel = Graph:WaitForChild("Y"):WaitForChild("Label")
- local Line = Point:Clone()
- Line.Name = "Line"
- Point.BackgroundColor3 = Color3.new(1, 1, 1)
- Line.BackgroundColor3 = Color3.fromRGB(160, 160, 160)
- Point.ZIndex = 2
- Graph.Point:Destroy()
- function DrawPoint(x, y, l)
- local New = Point:Clone()
- New.Position = UDim2.new(0, x, 0, 300)
- New.Parent = Graph
- New:TweenPosition(UDim2.new(0, x, 0, y), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.8)
- New.Label.Text = l or ""
- return New
- end
- function DrawLine(x0, y0, x1, y1)
- if type(x0) ~= "number" then
- x0, y0, x1, y1 = x0.Position.X.Offset, x0.Position.Y.Offset, y0.Position.X.Offset, y0.Position.Y.Offset
- end
- local New = Line:Clone()
- local mag = math.sqrt((x1 - x0) ^ 2 + (y1 - y0) ^ 2)
- New.Parent = Graph
- New.Rotation = math.deg(math.atan2(y1 - y0, x1 - x0))
- New:TweenSize(UDim2.new(0, mag, 0, 3), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.5)
- New.Position = UDim2.new(0, x0 + (x1 - x0) / 2, 0, y0 + (y1 - y0) / 2)
- New.Size = UDim2.new(0, mag, 0, 3)
- return New
- end
- function GraphPoints(points)
- local highest = 0
- for i, v in next, points, nil do
- if highest < v[2] then
- highest = v[2]
- end
- end
- local prev
- local abs = script.Parent.AbsoluteSize
- local draw = {}
- for i, v in next, points, nil do
- draw[#draw + 1] = DrawPoint((v[1] - 1) * (abs.X / (#points - 1)), -v[2] * ((abs.Y - 100) / highest) + (abs.Y - 50), v[2])
- end
- wait(0.8)
- for i, v in pairs(draw) do
- if draw[i - 1] then
- DrawLine(draw[i - 1], v)
- end
- end
- Graph.MaxY:TweenPosition(UDim2.new(-0.078, 0, 1, -255), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.5)
- Graph.MaxY.Text = highest
- end
- function r()
- return math.random(0, 300)
- end
- function getDataSet(size)
- local data = {}
- for i = 1, size do
- table.insert(data, {
- i * 30,
- r()
- })
- end
- return data
- end
- function Clear()
- for i, v in next, Graph:GetChildren() do
- if v.Name == "Point" or v.Name == "Line" then
- v:Destroy()
- end
- end
- end
- function LoadJoins()
- Clear()
- YLabel.Text = "Joins"
- Title.Text = "Joins per day"
- Loading.Visible = true
- local data = game.ReplicatedStorage.GetData:InvokeServer("joins")
- Loading.Visible = false
- GraphPoints(data)
- end
- function LoadUniqueJoins()
- Clear()
- YLabel.Text = "Unique joins"
- Title.Text = "Unique joins per day"
- Loading.Visible = true
- local data = game.ReplicatedStorage.GetData:InvokeServer("uniquejoins")
- Loading.Visible = false
- GraphPoints(data)
- end
- Graph.Buttons.Data1.MouseButton1Down:Connect(LoadJoins)
- Graph.Buttons.Data2.MouseButton1Down:Connect(LoadUniqueJoins)
- local open = false
- local toggler = script.Parent.Parent.tog
- toggler.MouseButton1Down:Connect(function()
- open = not open
- if open then
- script.Parent:TweenPosition(UDim2.new(0.5, -250, 0.5, -150), Enum.EasingDirection.In, Enum.EasingStyle.Quint, 0.6, true)
- else
- script.Parent:TweenPosition(UDim2.new(1.2, 0, 0.5, -150), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.6, true)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment