Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Sorry in advance for the mess. The newer versions have been updated with better and more organized code.
- local ChangeHistoryService = game:GetService("ChangeHistoryService")
- local toolbar = plugin:CreateToolbar("Custom Leaderboards")
- local ToolbarButton = toolbar:CreateButton("Leaderboard+", "Make Custom Leaderboards", "rbxassetid://7059608654")
- local Opened = false
- local LeaderboardInfo = DockWidgetPluginGuiInfo.new(
- Enum.InitialDockState.Left,
- false, -- Widget will be initially enabled
- false, -- Don't override the previous enabled state
- 220, -- Default width of the floating window
- 300, -- Default height of the floating window
- 220, -- Minimum width of the floating window (optional)
- 300 -- Minimum height of the floating window (optional)
- )
- local PluginWidget = plugin:CreateDockWidgetPluginGui("Leaderboard+", LeaderboardInfo)
- PluginWidget.Title = "Leaderboard+ Settings"
- --[[Variables for the Leaderboard Interface]]
- local MainGui = script.Parent.LeaderboardInterface.MainFrame:Clone()
- MainGui.Parent = PluginWidget
- local MainButtons = MainGui.Holder.MainButtons
- local ColorPicker = MainGui.Holder.ColorPicker
- local BackgroundColorButton = MainButtons.BackgroundColorButton
- local GenerateButton = MainButtons.Generate
- local Path = MainButtons.Path
- local CustomDataToggle = MainButtons.CustomData.Toggle
- local ShowPremiumToggle = MainButtons.ShowPremium.Toggle
- local Textbox1 = ColorPicker.RGBInput.Blue.TextBox
- local Textbox2 = ColorPicker.RGBInput.Green.TextBox
- local Textbox3 = ColorPicker.RGBInput.Red.TextBox
- local ChosenColor = MainGui.ChosenColor
- local DisplayFrame = ColorPicker.Display
- local NewLeaderboard = nil
- --[[Handle Clicks]]
- ToolbarButton.Click:Connect(function()
- PluginWidget.Enabled = not PluginWidget.Enabled
- NewLeaderboard = nil
- NewLeaderboard = script.Parent.CustomLeaderboard:Clone()
- end)
- BackgroundColorButton.MouseButton1Click:Connect(function()
- MainButtons.Visible = false
- ColorPicker.Visible = true
- end)
- ColorPicker.Finish.MouseButton1Click:Connect(function()
- MainButtons.Visible = true
- ColorPicker.Visible = false
- end)
- GenerateButton.MouseButton1Click:Connect(function()
- if game.StarterGui:FindFirstChild("CustomLeaderboard") then
- game.StarterGui:FindFirstChild("CustomLeaderboard"):Destroy()
- end
- NewLeaderboard.LeaderboardFrame.BackgroundColor3 = ChosenColor.Value
- NewLeaderboard.LeaderboardHandler.Disabled = false
- NewLeaderboard.LocalHandler.Disabled = false
- if NewLeaderboard.Settings.CustomData.Value == true then
- NewLeaderboard.LeaderboardFrame.HoldingFrame.Sample.Currency1.Visible = true
- NewLeaderboard.LeaderboardFrame.TitleCurrency.Visible = true
- end
- local PathText = "script.Parent.Settings.CustomData"
- if Path.Text ~= " " and Path.Text ~= nil and Path.Text ~= "" then
- PathText = Path.Text
- end
- local LeaderboardScript = NewLeaderboard.LeaderboardHandler
- LeaderboardScript.Source = [[
- --Custom Leaderboard Script. Made by Leaderboard+ plugin (by Infinite_Visions).
- --Find the plugin here: https://www.roblox.com/library/7066294774/Leaderboard
- local Path = nil
- --Setup Players Already In-Game
- for i, player in pairs(game.Players:GetChildren()) do
- --Add a slot to the leaderboard
- local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
- NewSlot.Name = player.Name
- NewSlot.PlrName.Text = player.Name
- if player.MembershipType == Enum.MembershipType.Premium then
- if script.Parent.Settings.ShowPremium.Value == true then
- NewSlot.Premium.Visible = true
- end
- end
- NewSlot.Visible = true
- --The Path to the Values you want displayed, if any.
- if script.Parent.Settings.CustomData.Value == true then
- Path = ]] ..PathText..[[
- Path.Changed:Connect(function()
- NewSlot.Currency1.Text = Path.Value
- end)
- end
- NewSlot.Parent = script.Parent.LeaderboardFrame.HoldingFrame
- end
- game.Players.PlayerAdded:Connect(function(player)
- --Add a slot to the leaderboard
- local NewSlot = script.Parent.LeaderboardFrame.HoldingFrame.Sample:Clone()
- NewSlot.Name = player.Name
- NewSlot.PlrName.Text = player.Name
- if player.MembershipType == Enum.MembershipType.Premium then
- if script.Parent.Settings.ShowPremium.Value == true then
- NewSlot.Premium.Visible = true
- end
- end
- NewSlot.Visible = true
- --The Path to the Values you want displayed, if any.
- if script.Parent.Settings.CustomData.Value == true then
- Path = ]] ..PathText..[[
- Path.Changed:Connect(function()
- NewSlot.Currency1.Text = Path.Value
- end)
- end
- NewSlot.Parent = script.Parent.LeaderboardFrame.HoldingFrame
- end)
- ]]
- NewLeaderboard.Parent = game.StarterGui
- end)
- CustomDataToggle.MouseButton1Click:Connect(function()
- if CustomDataToggle.Text == "✔" then
- CustomDataToggle.Parent.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- CustomDataToggle.BackgroundColor3 = Color3.fromRGB(99, 16, 0)
- NewLeaderboard.Settings.CustomData.Value = false
- CustomDataToggle.Text = "❌"
- Path.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- else
- CustomDataToggle.Parent.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- NewLeaderboard.Settings.CustomData.Value = true
- CustomDataToggle.BackgroundColor3 = Color3.fromRGB(48, 156, 9)
- Path.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- CustomDataToggle.Text = "✔"
- end
- end)
- ShowPremiumToggle.MouseButton1Click:Connect(function()
- if ShowPremiumToggle.Text == "✔" then
- ShowPremiumToggle.Parent.BackgroundColor3 = Color3.fromRGB(79, 79, 79)
- NewLeaderboard.Settings.ShowPremium.Value = false
- ShowPremiumToggle.BackgroundColor3 = Color3.fromRGB(99, 16, 0)
- ShowPremiumToggle.Text = "❌"
- else
- ShowPremiumToggle.Parent.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- NewLeaderboard.Settings.ShowPremium.Value = true
- ShowPremiumToggle.BackgroundColor3 = Color3.fromRGB(48, 156, 9)
- ShowPremiumToggle.Text = "✔"
- end
- end)
- --[[Handle Background Color]]
- local R = 0
- local G = 0
- local B = 0
- Textbox1:GetPropertyChangedSignal("Text"):Connect(function()
- Textbox1.Text = Textbox1.Text:gsub('%D+', '');
- if Textbox1.Text == " " or Textbox1.Text == nil then
- B = 0
- else
- B = tonumber(Textbox1.Text)
- end
- ChosenColor.Value = Color3.fromRGB(R,G,B)
- DisplayFrame.BackgroundColor3 = Color3.fromRGB(R,G,B)
- NewLeaderboard.LeaderboardFrame.Close.BackgroundColor3 = Color3.fromRGB(R,G,B)
- end)
- Textbox2:GetPropertyChangedSignal("Text"):Connect(function()
- Textbox2.Text = Textbox2.Text:gsub('%D+', '');
- if Textbox2.Text == " " or Textbox2.Text == nil then
- G = 0
- else
- G = tonumber(Textbox2.Text)
- end
- ChosenColor.Value = Color3.fromRGB(R,G,B)
- DisplayFrame.BackgroundColor3 = Color3.fromRGB(R,G,B)
- NewLeaderboard.LeaderboardFrame.Close.BackgroundColor3 = Color3.fromRGB(R,G,B)
- end)
- Textbox3:GetPropertyChangedSignal("Text"):Connect(function()
- Textbox3.Text = Textbox3.Text:gsub('%D+', '');
- if Textbox3.Text == " " or Textbox3.Text == nil then
- R = 0
- else
- R = tonumber(Textbox3.Text)
- end
- ChosenColor.Value = Color3.fromRGB(R,G,B)
- DisplayFrame.BackgroundColor3 = Color3.fromRGB(R,G,B)
- NewLeaderboard.LeaderboardFrame.Close.BackgroundColor3 = Color3.fromRGB(R,G,B)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement