Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UserInputService = game:GetService("UserInputService")
- local TweenService = game:GetService("TweenService")
- local Coasting = Instance.new("ScreenGui")
- local CoastsMain = Instance.new("ImageLabel")
- local Topbar = Instance.new("ImageLabel")
- local Title = Instance.new("Frame")
- local LogoTitle = Instance.new("TextLabel")
- local TabsHolder = Instance.new("Frame")
- local TabButtonLayout = Instance.new("UIListLayout")
- local TabsBodyHolder = Instance.new("Frame")
- local config = {};
- pcall(function()
- config = game:GetService("HttpService"):JSONDecode(readfile(tostring(game.PlaceId) .. ".txt"));
- end);
- local function saveConfig()
- writefile(tostring(game.PlaceId) .. ".txt", game:GetService("HttpService"):JSONEncode(config));
- end;
- --Library Configuration
- local Library = {
- Colors = {
- Topbar = Color3.fromRGB(45, 45, 45);
- Body = Color3.fromRGB(25, 25, 25);
- TabSelected = Color3.fromRGB(25, 25, 25);
- Section = Color3.fromRGB(35, 35, 35);
- CheckboxChecked = Color3.fromRGB(69, 85, 231);
- CheckboxUnchecked = Color3.fromRGB(35, 35, 35);
- Button = Color3.fromRGB(35, 35, 35);
- Slider = Color3.fromRGB(69, 85, 231);
- SliderBackground = Color3.fromRGB(35, 35, 35);
- Dropdown = Color3.fromRGB(35, 35, 35);
- DropdownButtonHover = Color3.fromRGB(45, 45, 45);
- Border = Color3.fromRGB(0, 0, 0);
- Text = Color3.fromRGB(255, 255, 255);
- ColorPickerMarker = Color3.fromRGB(150, 150, 150);
- Overbackground = Color3.fromRGB(35, 35, 35);
- PlaceholderText = Color3.fromRGB(255, 255, 255);
- };
- Settings = {
- MainTextSize = 15;
- MainTextFont = Enum.Font.GothamBold;
- UIToggleKey = Enum.KeyCode.RightControl;
- TweenEasingStyle = Enum.EasingStyle.Quart;
- }
- }
- --Library.Colors.
- --Library.Settings.
- --Main
- Coasting.Name = "Coasting"
- Coasting.Parent = game:GetService("CoreGui")
- CoastsMain.Name = "CoastsMain"
- CoastsMain.Parent = Coasting
- CoastsMain.BackgroundColor3 = Library.Colors.Border
- CoastsMain.BackgroundTransparency = 1
- CoastsMain.BorderColor3 = Library.Colors.Border
- CoastsMain.ClipsDescendants = true
- CoastsMain.BorderSizePixel = 0
- CoastsMain.Position = UDim2.new(0.129598662, 0, 0.130221128, 0)
- CoastsMain.Size = UDim2.new(0, 413, 0, 0)
- CoastsMain.Image = "rbxassetid://3570695787"
- CoastsMain.ImageColor3 = Library.Colors.Body
- CoastsMain.ScaleType = Enum.ScaleType.Slice
- CoastsMain.SliceCenter = Rect.new(100, 100, 100, 100)
- CoastsMain.SliceScale = 0.06
- CoastsMain.ImageTransparency = 1
- Topbar.Name = "Topbar"
- Topbar.Parent = CoastsMain
- Topbar.BackgroundColor3 = Library.Colors.Border
- Topbar.BackgroundTransparency = 1
- Topbar.BorderColor3 = Library.Colors.Border
- Topbar.BorderSizePixel = 0
- Topbar.Position = UDim2.new(0, 0, 0, 0)
- Topbar.Size = UDim2.new(1, 0, 0.00403225794, 9)
- Topbar.Image = "rbxassetid://4530319192"
- Topbar.ImageColor3 = Library.Colors.Topbar
- Topbar.ScaleType = Enum.ScaleType.Slice
- Topbar.SliceCenter = Rect.new(20, 20, 480, 480)
- Topbar.SliceScale = 1
- Topbar.ImageTransparency = 1
- Title.Name = "Title"
- Title.Parent = CoastsMain
- Title.BackgroundColor3 = Library.Colors.Overbackground
- Title.BackgroundTransparency = 1
- Title.BorderColor3 = Library.Colors.Border
- Title.BorderSizePixel = 0
- Title.Position = UDim2.new(0, 0, 0.0403225794, 0)
- Title.Size = UDim2.new(0, 102, 0, 29)
- Title.Visible = false
- LogoTitle.Name = "LogoTitle"
- LogoTitle.Parent = Title
- LogoTitle.BackgroundColor3 = Library.Colors.Border
- LogoTitle.BackgroundTransparency = 1
- LogoTitle.BorderColor3 = Library.Colors.Border
- LogoTitle.BorderSizePixel = 0
- LogoTitle.Size = UDim2.new(0, 75, 0, 29)
- LogoTitle.Font = Library.Settings.MainTextFont
- LogoTitle.Text = " Bear Hub"
- LogoTitle.TextColor3 = Library.Colors.Text
- LogoTitle.TextSize = Library.Settings.MainTextSize
- LogoTitle.TextTransparency = 1
- TabsHolder.Name = "TabsHolder"
- TabsHolder.Parent = CoastsMain
- TabsHolder.BackgroundColor3 = Library.Colors.Overbackground
- TabsHolder.BackgroundTransparency = 1
- TabsHolder.BorderColor3 = Library.Colors.Border
- TabsHolder.BorderSizePixel = 0
- TabsHolder.ClipsDescendants = true
- TabsHolder.Position = UDim2.new(0.246973366, 0, 0.0403225794, 0)
- TabsHolder.Size = UDim2.new(0, 311, 0, 29)
- TabsHolder.Visible = false
- TabButtonLayout.Name = "TabButtonLayout"
- TabButtonLayout.Parent = TabsHolder
- TabButtonLayout.FillDirection = Enum.FillDirection.Horizontal
- TabButtonLayout.SortOrder = Enum.SortOrder.LayoutOrder
- TabButtonLayout.Padding = UDim.new(0, 4)
- TabsBodyHolder.Name = "TabsBodyHolder"
- TabsBodyHolder.Parent = CoastsMain
- TabsBodyHolder.BackgroundColor3 = Library.Colors.Border
- TabsBodyHolder.BackgroundTransparency = 1
- TabsBodyHolder.BorderColor3 = Library.Colors.Border
- TabsBodyHolder.BorderSizePixel = 0
- TabsBodyHolder.Position = UDim2.new(0.0155901965, 0, 0.189516127, 0)
- TabsBodyHolder.Size = UDim2.new(0, 400, 0, 194)
- TabsBodyHolder.Visible = false
- UserInputService.InputBegan:Connect(function(input)
- if input.KeyCode == Library.Settings.UIToggleKey then
- Coasting.Enabled = not Coasting.Enabled
- end
- end)
- --Dragging
- local Dragging
- local DragInput
- local DragStart
- local StartPosition
- local function update(input)
- local Delta = input.Position - DragStart
- TweenService:Create(CoastsMain, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(StartPosition.X.Scale, StartPosition.X.Offset + Delta.X, StartPosition.Y.Scale, StartPosition.Y.Offset + Delta.Y)}):Play();
- end
- Topbar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- Dragging = true
- DragStart = input.Position
- StartPosition = CoastsMain.Position
- input.Changed:Connect(function()
- if input.UserInputState == Enum.UserInputState.End then
- Dragging = false
- end
- end)
- end
- end)
- Topbar.InputChanged:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- DragInput = input
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if input == DragInput and Dragging then
- update(input)
- end
- end)
- --Hub Intro Functions
- function Library:SetTab(TabName)
- for i, v in pairs(TabsBodyHolder:GetChildren()) do
- v.Visible = false
- end
- for i, v in pairs(TabsHolder:GetChildren()) do
- if v:IsA("ImageButton") then
- v.ImageColor3 = Library.Colors.Button
- end
- end
- for i, v in pairs(TabsBodyHolder:GetChildren()) do
- if v.Name == (TabName .. "BodyTab") then
- v.Visible = true
- end
- end
- for i, v in pairs(TabsHolder:GetChildren()) do
- if v.Name == (TabName .. "TabButton") then
- TweenService:Create(v, TweenInfo.new(0.2, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageColor3 = Library.Colors.Body}):Play()
- end
- end
- end
- function FadeInButtons()
- for i, v in pairs(TabsHolder:GetChildren()) do
- if v:IsA("ImageButton") then
- v.ImageTransparency = 1
- for x, y in pairs(v:GetChildren()) do
- if y:IsA("TextLabel") then
- y.TextTransparency = 1
- end
- end
- end
- end
- for i, v in pairs(TabsHolder:GetChildren()) do
- if v:IsA("ImageButton") then
- TweenService:Create(v, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
- for x, y in pairs(v:GetChildren()) do
- if y:IsA("TextLabel") then
- TweenService:Create(y, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
- end
- end
- end
- end
- end
- --Main Hub Intro
- function HubIntro()
- FadeInButtons()
- TweenService:Create(LogoTitle, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
- TweenService:Create(Topbar, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
- TweenService:Create(TabsHolder, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
- TweenService:Create(Title, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {BackgroundTransparency = 0}):Play()
- end
- function Library:Intro()
- wait(0.15)
- TweenService:Create(CoastsMain, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 0}):Play()
- TweenService:Create(CoastsMain, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 413, 0, 248)}):Play()
- wait(0.75)
- Title.Visible = true
- TabsHolder.Visible = true
- TabsBodyHolder.Visible = true
- wait(0.15)
- HubIntro()
- end
- --UI Library
- function Library:CreateTab(tabtitle)
- local NameTabButton = Instance.new("ImageButton")
- local NameTabTitle = Instance.new("TextLabel")
- local NameBodyTab = Instance.new("ScrollingFrame")
- local BodyTabLayout = Instance.new("UIListLayout")
- NameTabButton.Name = (tabtitle .. "TabButton")
- NameTabButton.Parent = TabsHolder
- NameTabButton.BackgroundColor3 = Library.Colors.Border
- NameTabButton.BackgroundTransparency = 1
- NameTabButton.BorderColor3 = Library.Colors.Border
- NameTabButton.BorderSizePixel = 0
- NameTabButton.Size = UDim2.new(0, 0, 0, 29)
- NameTabButton.AutoButtonColor = false
- NameTabButton.Image = "rbxassetid://4530319192"
- NameTabButton.ImageColor3 = Library.Colors.Body
- NameTabButton.ScaleType = Enum.ScaleType.Slice
- NameTabButton.SliceCenter = Rect.new(20, 20, 480, 480)
- NameTabButton.SliceScale = 1
- NameTabButton.ImageTransparency = 1
- NameTabTitle.Name = (tabtitle .. "TabTitle")
- NameTabTitle.Parent = NameTabButton
- NameTabTitle.BackgroundColor3 = Library.Colors.Border
- NameTabTitle.BackgroundTransparency = 1
- NameTabTitle.BorderColor3 = Library.Colors.Border
- NameTabTitle.BorderSizePixel = 0
- NameTabTitle.Size = UDim2.new(0, 0, 0, 29)
- NameTabTitle.Font = Library.Settings.MainTextFont
- NameTabTitle.Text = tabtitle
- NameTabTitle.TextColor3 = Library.Colors.Text
- NameTabTitle.TextSize = Library.Settings.MainTextSize
- NameTabTitle.Size = UDim2.new(0, NameTabTitle.TextBounds.X + 15, 0, 29)
- NameTabButton.Size = UDim2.new(0, NameTabTitle.TextBounds.X + 15, 0, 29)
- NameTabTitle.TextTransparency = 1
- local function ExtendCanvasSize(tab)
- tab.CanvasSize = UDim2.new(0, 0, 0, (#tab:GetChildren() - 0) * 36)
- tab.CanvasPosition = Vector2.new(0, 0)
- end
- NameBodyTab.Name = (tabtitle .. "BodyTab")
- NameBodyTab.Parent = TabsBodyHolder
- NameBodyTab.BackgroundColor3 = Library.Colors.Border
- NameBodyTab.BackgroundTransparency = 1
- NameBodyTab.BorderColor3 = Library.Colors.Border
- NameBodyTab.BorderSizePixel = 0
- NameBodyTab.Size = UDim2.new(0, 400, 0, 194)
- NameBodyTab.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
- NameBodyTab.CanvasPosition = Vector2.new(0, 48.5)
- ExtendCanvasSize(NameBodyTab)
- NameBodyTab.ScrollBarThickness = 2
- NameBodyTab.TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
- BodyTabLayout.Name = (tabtitle .."BodyTabLayout")
- BodyTabLayout.Parent = NameBodyTab
- BodyTabLayout.SortOrder = Enum.SortOrder.LayoutOrder
- BodyTabLayout.Padding = UDim.new(0, 5)
- NameTabButton.MouseButton1Click:Connect(function()
- Library:SetTab(tabtitle)
- end)
- local CoastsLibrary = {}
- function RippleEffect(button)
- spawn(function()
- local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
- local RippleHolder = Instance.new("Frame")
- local RippleEffect = Instance.new("ImageLabel")
- RippleHolder.Name = "RippleHolder"
- RippleHolder.Parent = button
- RippleHolder.BackgroundColor3 = Library.Colors.Border
- RippleHolder.BackgroundTransparency = 1
- RippleHolder.BorderColor3 = Library.Colors.Border
- RippleHolder.BorderSizePixel = 0
- RippleHolder.ClipsDescendants = true
- RippleHolder.Size = UDim2.new(0, 400, 0, 32)
- RippleEffect.Name = "RippleEffect"
- RippleEffect.Parent = RippleHolder
- RippleEffect.BackgroundTransparency = 1
- RippleEffect.BorderSizePixel = 0
- RippleEffect.Image = "rbxassetid://2708891598"
- RippleEffect.ImageColor3 = Color3.fromRGB(255, 255, 255)
- RippleEffect.ImageTransparency = 0.8
- RippleEffect.ScaleType = Enum.ScaleType.Fit
- RippleEffect.Position = UDim2.new((Mouse.X - RippleEffect.AbsolutePosition.X) / button.AbsoluteSize.X, 0, (Mouse.Y - RippleEffect.AbsolutePosition.Y) / button.AbsoluteSize.Y, 0)
- TweenService:Create(RippleEffect, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Position = UDim2.new(-5.5, 0, -7.5, 0), Size = UDim2.new(12, 0, 16, 0)}):Play()
- wait(0.75)
- TweenService:Create(RippleEffect, TweenInfo.new(1, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
- wait(1)
- RippleHolder:Destroy()
- end)
- end
- function CoastsLibrary:CreateSection(sectionname)
- local NameSection = Instance.new("TextLabel")
- NameSection.Name = (sectionname .. "Section")
- NameSection.Parent = NameBodyTab
- NameSection.BackgroundColor3 = Library.Colors.Section
- NameSection.BorderColor3 = Library.Colors.Border
- NameSection.BorderSizePixel = 0
- NameSection.Size = UDim2.new(0, 400, 0, 25)
- NameSection.Font = Library.Settings.MainTextFont
- NameSection.Text = sectionname
- NameSection.TextColor3 = Library.Colors.Text
- NameSection.TextSize = Library.Settings.MainTextSize
- ExtendCanvasSize(NameBodyTab)
- end
- function CoastsLibrary:CreateButton(buttonname, action)
- local Button = Instance.new("TextButton")
- Button.Name = (buttonname .. "Button")
- Button.Parent = NameBodyTab
- Button.BackgroundColor3 = Library.Colors.Button
- Button.BorderColor3 = Library.Colors.Border
- Button.BorderSizePixel = 0
- Button.ClipsDescendants = true
- Button.Size = UDim2.new(0, 400, 0, 25)
- Button.AutoButtonColor = false
- Button.Font = Library.Settings.MainTextFont
- Button.Text = buttonname
- Button.TextColor3 = Library.Colors.Text
- Button.TextSize = Library.Settings.MainTextSize
- Button.MouseButton1Down:Connect(function()
- action()
- RippleEffect(Button)
- end)
- ExtendCanvasSize(NameBodyTab)
- end
- function CoastsLibrary:CreateCheckbox(checkboxname, action)
- local CheckboxHolder = Instance.new("Frame")
- local InfoText = Instance.new("TextLabel")
- local Checkbox = Instance.new("ImageButton")
- local ToggleAnimation = Instance.new("Frame")
- local Enabled = false
- CheckboxHolder.Name = (checkboxname .. "CheckboxHolder")
- CheckboxHolder.Parent = NameBodyTab
- CheckboxHolder.BackgroundColor3 = Library.Colors.Border
- CheckboxHolder.BackgroundTransparency = 1
- CheckboxHolder.BorderColor3 = Library.Colors.Border
- CheckboxHolder.BorderSizePixel = 0
- CheckboxHolder.Position = UDim2.new(0, 0, 0.170103088, 0)
- CheckboxHolder.Size = UDim2.new(0, 400, 0, 25)
- InfoText.Name = "InfoText"
- InfoText.Parent = CheckboxHolder
- InfoText.BackgroundColor3 = Library.Colors.Border
- InfoText.BackgroundTransparency = 1
- InfoText.BorderColor3 = Library.Colors.Border
- InfoText.BorderSizePixel = 0
- InfoText.Position = UDim2.new(0.00800000038, 0, 0, 0)
- InfoText.Size = UDim2.new(0, 196, 0, 24)
- InfoText.Font = Library.Settings.MainTextFont
- InfoText.Text = checkboxname
- InfoText.TextColor3 = Library.Colors.Text
- InfoText.TextSize = Library.Settings.MainTextSize
- InfoText.TextXAlignment = Enum.TextXAlignment.Left
- Checkbox.Name = (checkboxname .. "Checkbox")
- Checkbox.Parent = CheckboxHolder
- Checkbox.BackgroundColor3 = Library.Colors.Body
- Checkbox.BorderColor3 = Library.Colors.CheckboxChecked
- Checkbox.ClipsDescendants = true
- Checkbox.BorderSizePixel = 1
- Checkbox.Position = UDim2.new(0.925000012, 0, 0, 0)
- Checkbox.Size = UDim2.new(0, 24, 0, 24)
- Checkbox.AutoButtonColor = false
- Checkbox.Image = "rbxassetid://1202200114"
- ToggleAnimation.Name = "ToggleAnimation"
- ToggleAnimation.Parent = Checkbox
- ToggleAnimation.BackgroundColor3 = Library.Colors.Body
- ToggleAnimation.BorderColor3 = Library.Colors.Border
- ToggleAnimation.BorderSizePixel = 0
- ToggleAnimation.Position = UDim2.new(0, 0, 0, 0)
- ToggleAnimation.Size = UDim2.new(0, 24, 0, 24)
- Checkbox.MouseButton1Down:Connect(function()
- Enabled = not Enabled
- if Enabled then
- TweenService:Create(ToggleAnimation, TweenInfo.new(0.5, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Position = UDim2.new(0.966667175, 0, 0, 0), Size = UDim2.new(0, 0, 0, 24)}):Play()
- elseif not Enabled then
- TweenService:Create(ToggleAnimation, TweenInfo.new(0.5, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Position = UDim2.new(0, 0, 0, 0), Size = UDim2.new(0, 24, 0, 24)}):Play()
- end
- action(Enabled)
- end)
- ExtendCanvasSize(NameBodyTab)
- end
- function CoastsLibrary:CreateSlider(slidername, minimumvalue, maximumvalue, startvalue, precisevalue, action)
- local SliderHolder = Instance.new("Frame")
- local SliderTitleText = Instance.new("TextLabel")
- local SliderValueText = Instance.new("TextLabel")
- local SliderBackground = Instance.new("Frame")
- local SlidingSlider = Instance.new("Frame")
- local Dragging = false
- local PreciseSliderValue = precisevalue
- SliderHolder.Name = (slidername .. "SliderHolder")
- SliderHolder.Parent = NameBodyTab
- SliderHolder.BackgroundColor3 = Library.Colors.Border
- SliderHolder.BackgroundTransparency = 1
- SliderHolder.BorderColor3 = Library.Colors.Border
- SliderHolder.BorderSizePixel = 0
- SliderHolder.Position = UDim2.new(0, 0, 0.453608245, 0)
- SliderHolder.Size = UDim2.new(0, 400, 0, 35)
- SliderTitleText.Name = (slidername .. "SliderTitleText")
- SliderTitleText.Parent = SliderHolder
- SliderTitleText.BackgroundColor3 = Library.Colors.Border
- SliderTitleText.BackgroundTransparency = 1
- SliderTitleText.BorderColor3 = Library.Colors.Border
- SliderTitleText.BorderSizePixel = 0
- SliderTitleText.Position = UDim2.new(0.00800000038, 0, 0, 0)
- SliderTitleText.Size = UDim2.new(0, 196, 0, 24)
- SliderTitleText.Font = Library.Settings.MainTextFont
- SliderTitleText.Text = slidername
- SliderTitleText.TextColor3 = Library.Colors.Text
- SliderTitleText.TextSize = Library.Settings.MainTextSize
- SliderTitleText.TextXAlignment = Enum.TextXAlignment.Left
- SliderValueText.Name = (slidername .. "SliderValueText")
- SliderValueText.Parent = SliderHolder
- SliderValueText.BackgroundColor3 = Library.Colors.Border
- SliderValueText.BackgroundTransparency = 1
- SliderValueText.BorderColor3 = Library.Colors.Border
- SliderValueText.BorderSizePixel = 0
- SliderValueText.Position = UDim2.new(0.498903126, 0, 0, 0)
- SliderValueText.Size = UDim2.new(0, 194, 0, 24)
- SliderValueText.Font = Library.Settings.MainTextFont
- SliderValueText.Text = tostring(startvalue or PreciseSliderValue and tonumber(string.format("%.2f", startvalue)))
- SliderValueText.TextColor3 = Library.Colors.Text
- SliderValueText.TextSize = Library.Settings.MainTextSize
- SliderValueText.TextXAlignment = Enum.TextXAlignment.Right
- SliderBackground.Name = "SliderBackground"
- SliderBackground.Parent = SliderHolder
- SliderBackground.BackgroundColor3 = Library.Colors.SliderBackground
- SliderBackground.BorderColor3 =Library.Colors.Border
- SliderBackground.BorderSizePixel = 0
- SliderBackground.ClipsDescendants = true
- SliderBackground.Position = UDim2.new(0.00800000038, 0, 0.64599961, 0)
- SliderBackground.Size = UDim2.new(0.976000011, 0, -0.010000011, 10)
- SlidingSlider.Name = "SlidingSlider"
- SlidingSlider.Parent = SliderBackground
- SlidingSlider.BackgroundColor3 = Library.Colors.Slider
- SlidingSlider.BorderColor3 = Library.Colors.Border
- SlidingSlider.BorderSizePixel = 0
- SlidingSlider.Position = UDim2.new(0, 0, 0, 0)
- SlidingSlider.Size = UDim2.new((startvalue or 0) / maximumvalue, 0, 0, 10)
- local function Sliding(input)
- local Pos = UDim2.new(math.clamp((input.Position.X - SliderBackground.AbsolutePosition.X) / SliderBackground.AbsoluteSize.X, 0, 1), 0, 1, 0)
- --SlidingSlider.Size = Pos
- TweenService:Create(SlidingSlider, TweenInfo.new(0.10, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = Pos}):Play()
- local NonSliderPreciseValue = math.floor(((Pos.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue)
- local SliderPreciseValue = ((Pos.X.Scale * maximumvalue) / maximumvalue) * (maximumvalue - minimumvalue) + minimumvalue
- local Value = (PreciseSliderValue and SliderPreciseValue or NonSliderPreciseValue)
- Value = tonumber(string.format("%.2f", Value))
- SliderValueText.Text = tostring(Value)
- action(Value)
- end;
- SliderBackground.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- Dragging = true
- end
- end)
- SliderBackground.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- Dragging = false
- end
- end)
- SliderBackground.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- Sliding(input)
- end
- end)
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if Dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- Sliding(input)
- end
- end)
- ExtendCanvasSize(NameBodyTab)
- end
- function CoastsLibrary:CreateColorPicker(colorpickername, colorpickerpresetcolor, action)
- local ColorPickerHolder = Instance.new("Frame")
- local ColorPickerTitleText = Instance.new("TextLabel")
- local ColorPickerButton = Instance.new("TextButton")
- local ColorPickerMain = Instance.new("Frame")
- local ColorPallete = Instance.new("ImageLabel")
- local ColorPalleteMarker = Instance.new("ImageLabel")
- local ColorBrightness = Instance.new("ImageLabel")
- local ColorBrightnessMarker = Instance.new("Frame")
- local ColorRed = Instance.new("TextLabel")
- local ColorGreen = Instance.new("TextLabel")
- local ColorBlue = Instance.new("TextLabel")
- local HSD = false
- local VD = false
- local ColorPickerMainOpen = false
- ColorPickerHolder.Name = (colorpickername .. "ColorPickerHolder")
- ColorPickerHolder.Parent = NameBodyTab
- ColorPickerHolder.BackgroundColor3 = Library.Colors.Border
- ColorPickerHolder.BackgroundTransparency = 1
- ColorPickerHolder.BorderColor3 = Library.Colors.Border
- ColorPickerHolder.BorderSizePixel = 0
- ColorPickerHolder.Position = UDim2.new(0, 0, 0.170103088, 0)
- ColorPickerHolder.Size = UDim2.new(0, 400, 0, 25)
- ColorPickerTitleText.Name = "ColorPickerTitleText"
- ColorPickerTitleText.Parent = ColorPickerHolder
- ColorPickerTitleText.BackgroundColor3 = Library.Colors.Border
- ColorPickerTitleText.BackgroundTransparency = 1
- ColorPickerTitleText.BorderColor3 = Library.Colors.Border
- ColorPickerTitleText.BorderSizePixel = 0
- ColorPickerTitleText.Position = UDim2.new(0.00800000038, 0, 0, 0)
- ColorPickerTitleText.Size = UDim2.new(0, 196, 0, 24)
- ColorPickerTitleText.Font = Library.Settings.MainTextFont
- ColorPickerTitleText.Text = colorpickername
- ColorPickerTitleText.TextColor3 = Library.Colors.Text
- ColorPickerTitleText.TextSize = Library.Settings.MainTextSize
- ColorPickerTitleText.TextXAlignment = Enum.TextXAlignment.Left
- ColorPickerButton.Name = "ColorPickerButton"
- ColorPickerButton.Parent = ColorPickerHolder
- ColorPickerButton.BackgroundColor3 = colorpickerpresetcolor or Color3.fromRGB(255, 255, 255);
- ColorPickerButton.BorderColor3 = colorpickerpresetcolor or Color3.fromRGB(255, 255, 255);
- ColorPickerButton.BorderSizePixel = 1
- ColorPickerButton.Position = UDim2.new(0.925000012, 0, 0, 0)
- ColorPickerButton.Size = UDim2.new(0, 24, 0, 24)
- ColorPickerButton.AutoButtonColor = false
- ColorPickerButton.Font = Library.Settings.MainTextFont
- ColorPickerButton.Text = ""
- ColorPickerButton.TextColor3 = Color3.new(255, 255, 255)
- ColorPickerButton.TextSize = Library.Settings.MainTextSize
- local Red, Green, Blue = ColorPickerButton.BackgroundColor3.r * 255, ColorPickerButton.BackgroundColor3.g * 255, ColorPickerButton.BackgroundColor3.b * 255;
- ColorPickerMain.Name = "ColorPickerMain"
- ColorPickerMain.Parent = ColorPickerHolder
- ColorPickerMain.BackgroundColor3 = Library.Colors.Body
- ColorPickerMain.BorderColor3 = Library.Colors.Border
- ColorPickerMain.BorderSizePixel = 0
- ColorPickerMain.ClipsDescendants = true
- ColorPickerMain.Position = UDim2.new(0.91, 1, 0.06666667, -3)
- ColorPickerMain.Size = UDim2.new(0, 0, 0, 130)
- ColorPickerMain.ZIndex = 2
- ColorPallete.Name = "ColorPallete"
- ColorPallete.Parent = ColorPickerMain
- ColorPallete.BackgroundColor3 = Library.Colors.Border
- ColorPallete.BackgroundTransparency = 1
- ColorPallete.BorderColor3 = Library.Colors.Border
- ColorPallete.BorderSizePixel = 0
- ColorPallete.Position = UDim2.new(0, 5, 0, 4)
- ColorPallete.Size = UDim2.new(0, 119, 0, 121)
- ColorPallete.ZIndex = 2
- ColorPallete.Image = "rbxassetid://4477380641"
- ColorPalleteMarker.Name = "ColorPalleteMarker"
- ColorPalleteMarker.Parent = ColorPallete
- ColorPalleteMarker.BackgroundColor3 = Library.Colors.Border
- ColorPalleteMarker.BackgroundTransparency = 1
- ColorPalleteMarker.BorderColor3 = Library.Colors.Border
- ColorPalleteMarker.BorderSizePixel = 0
- ColorPalleteMarker.Position = UDim2.new(colorpickerpresetcolor and select(1, Color3.toHSV(colorpickerpresetcolor)) or 0, 0, colorpickerpresetcolor and 1 - select(2, Color3.toHSV(colorpickerpresetcolor)) or 0, 0)
- ColorPalleteMarker.Size = UDim2.new(0, 0, 0.200000003, 0)
- ColorPalleteMarker.ZIndex = 2
- ColorPalleteMarker.Image = "rbxassetid://4409133510"
- ColorPalleteMarker.ScaleType = Enum.ScaleType.Crop
- ColorBrightness.Name = "ColorBrightness"
- ColorBrightness.Parent = ColorPickerMain
- ColorBrightness.AnchorPoint = Vector2.new(1, 0)
- ColorBrightness.BackgroundColor3 = Library.Colors.Border
- ColorBrightness.BorderColor3 = Library.Colors.Border
- ColorBrightness.BorderSizePixel = 0
- ColorBrightness.Position = UDim2.new(0, 145, 0, 4)
- ColorBrightness.Size = UDim2.new(0, 14, 0, 121)
- ColorBrightness.ZIndex = 2
- ColorBrightness.Image = "rbxassetid://4477380092"
- ColorBrightness.ScaleType = Enum.ScaleType.Crop
- ColorBrightnessMarker.Name = "ColorBrightnessMarker"
- ColorBrightnessMarker.Parent = ColorBrightness
- ColorBrightnessMarker.AnchorPoint = Vector2.new(0, 0.5)
- ColorBrightnessMarker.BackgroundColor3 = Library.Colors.ColorPickerMarker
- ColorBrightnessMarker.BorderColor3 = Library.Colors.Border
- ColorBrightnessMarker.BorderSizePixel = 1
- ColorBrightnessMarker.Position = UDim2.new(0, 0, 0.013245035, 0)
- ColorBrightnessMarker.Size = UDim2.new(1, 0, 0.0280000009, 0)
- ColorBrightnessMarker.ZIndex = 2
- ColorRed.Name = "ColorRed"
- ColorRed.Parent = ColorPickerMain
- ColorRed.BackgroundColor3 = Library.Colors.Border
- ColorRed.BackgroundTransparency = 1
- ColorRed.BorderColor3 = Library.Colors.Border
- ColorRed.BorderSizePixel = 0
- ColorRed.Position = UDim2.new(0, 150, 0, 0)
- ColorRed.Size = UDim2.new(0, 55, 0, 20)
- ColorRed.Font = Library.Settings.MainTextFont
- ColorRed.Text = ("R: " .. math.floor(Red))
- ColorRed.TextColor3 = Color3.fromRGB(255, 40, 40)
- ColorRed.TextSize = Library.Settings.MainTextSize
- ColorRed.TextXAlignment = Enum.TextXAlignment.Left
- ColorRed.ZIndex = 2
- ColorGreen.Name = "ColorGreen"
- ColorGreen.Parent = ColorPickerMain
- ColorGreen.BackgroundColor3 = Library.Colors.Border
- ColorGreen.BackgroundTransparency = 1
- ColorGreen.BorderColor3 = Library.Colors.Border
- ColorGreen.BorderSizePixel = 0
- ColorGreen.Position = UDim2.new(0, 150, 0, 55)
- ColorGreen.Size = UDim2.new(0, 55, 0, 20)
- ColorGreen.Font = Library.Settings.MainTextFont
- ColorGreen.Text = ("G: " .. math.floor(Green))
- ColorGreen.TextColor3 = Color3.fromRGB(94, 241, 61)
- ColorGreen.TextSize = Library.Settings.MainTextSize
- ColorGreen.TextXAlignment = Enum.TextXAlignment.Left
- ColorGreen.ZIndex = 2
- ColorBlue.Name = "ColorBlue"
- ColorBlue.Parent = ColorPickerMain
- ColorBlue.BackgroundColor3 = Library.Colors.Border
- ColorBlue.BackgroundTransparency = 1
- ColorBlue.BorderColor3 = Library.Colors.Border
- ColorBlue.BorderSizePixel = 0
- ColorBlue.Position = UDim2.new(0, 150, 0, 110)
- ColorBlue.Size = UDim2.new(0, 55, 0, 20)
- ColorBlue.Font = Library.Settings.MainTextFont
- ColorBlue.Text = ("B: " .. math.floor(Blue))
- ColorBlue.TextColor3 = Color3.fromRGB(0, 174, 255)
- ColorBlue.TextSize = Library.Settings.MainTextSize
- ColorBlue.TextXAlignment = Enum.TextXAlignment.Left
- ColorBlue.ZIndex = 2
- ColorPickerButton.MouseButton1Click:Connect(function()
- if not ColorPickerMainOpen then
- TweenService:Create(NameBodyTab, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 42)}):Play()
- --NameBodyTab.CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 42)
- NameBodyTab.ClipsDescendants = true
- CoastsMain.ClipsDescendants = true
- ColorPickerMainOpen = true
- TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, -200, 0, 130)}):Play()
- elseif ColorPickerMainOpen then
- --NameBodyTab.CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 36)
- TweenService:Create(NameBodyTab, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {CanvasSize = UDim2.new(0, 0, 0, (#NameBodyTab:GetChildren() - 0) * 36)}):Play()
- ColorPickerMainOpen = false
- NameBodyTab.ClipsDescendants = true
- CoastsMain.ClipsDescendants = true
- HSD = false
- VD = false
- TweenService:Create(ColorPickerMain, TweenInfo.new(0.75, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 130)}):Play()
- end
- end)
- ColorPallete.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- HSD = true
- end
- end)
- ColorPallete.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- HSD = false
- end
- end)
- ColorBrightness.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- VD = true
- end
- end)
- ColorBrightness.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- VD = false
- end
- end)
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if HSD and input.UserInputType == Enum.UserInputType.MouseMovement then
- Red, Green, Blue = ColorPickerButton.BackgroundColor3.r * 255, ColorPickerButton.BackgroundColor3.g * 255, ColorPickerButton.BackgroundColor3.b * 255;
- ColorRed.Text = ("R: " .. math.floor(Red))
- ColorGreen.Text = ("G: " .. math.floor(Green))
- ColorBlue.Text = ("B: " .. math.floor(Blue))
- ColorPalleteMarker.Position = UDim2.new(math.clamp((input.Position.X - ColorPallete.AbsolutePosition.X) / ColorPallete.AbsoluteSize.X, 0, 1), 0, math.clamp((input.Position.Y - ColorPallete.AbsolutePosition.Y) / ColorPallete.AbsoluteSize.Y, 0, 1), 0)
- ColorPickerButton.BackgroundColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
- ColorPickerButton.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
- ColorBrightnessMarker.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
- action(ColorPickerButton.BackgroundColor3)
- elseif VD and input.UserInputType == Enum.UserInputType.MouseMovement then
- Red, Green, Blue = ColorPickerButton.BackgroundColor3.r * 255, ColorPickerButton.BackgroundColor3.g * 255, ColorPickerButton.BackgroundColor3.b * 255;
- ColorRed.Text = ("R: " .. math.floor(Red))
- ColorGreen.Text = ("G: " .. math.floor(Green))
- ColorBlue.Text = ("B: " .. math.floor(Blue))
- ColorBrightnessMarker.Position = UDim2.new(0, 0, math.clamp((input.Position.Y - ColorBrightness.AbsolutePosition.Y) / ColorBrightness.AbsoluteSize.Y, 0, 1), 0)
- ColorPickerButton.BackgroundColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
- ColorPickerButton.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
- ColorBrightnessMarker.BorderColor3 = Color3.fromHSV(ColorPalleteMarker.Position.X.Scale, 1 - ColorPalleteMarker.Position.Y.Scale, 1 - ColorBrightnessMarker.Position.Y.Scale)
- action(ColorPickerButton.BackgroundColor3)
- end
- end)
- NameTabButton.MouseButton1Down:Connect(function()
- ColorPickerMainOpen = false
- HSD = false
- VD = false
- NameBodyTab.ClipsDescendants = true
- CoastsMain.ClipsDescendants = true
- TweenService:Create(ColorPickerMain, TweenInfo.new(0.01, Library.Settings.TweenEasingStyle, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 130)}):Play()
- end)
- ExtendCanvasSize(NameBodyTab)
- end
- return CoastsLibrary;
- end
- return Library;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement