Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local KeylimeLibrary = {}
- local xThing = 0
- local yThing = 0.044822257
- local TweenService = game:GetService("TweenService")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- local function CreateBaseObject(Class)
- if Class == "Button" then
- local Button = Instance.new("TextButton")
- local Roundify = Instance.new("ImageLabel")
- Button.Name = Class
- Button.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
- Button.BackgroundTransparency = 1.000
- Button.BorderSizePixel = 0
- Button.Position = UDim2.new(0, 0, 0.129380047, 0)
- Button.Size = UDim2.new(1, 0, 0, 30)
- Button.ZIndex = 2
- Button.Font = Enum.Font.GothamSemibold
- Button.TextColor3 = Color3.fromRGB(255, 255, 255)
- Button.TextSize = 14.000
- Roundify.Name = "Roundify"
- Roundify.Parent = Button
- Roundify.Active = true
- Roundify.AnchorPoint = Vector2.new(0.5, 0.5)
- Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Roundify.BackgroundTransparency = 1.000
- Roundify.Position = UDim2.new(0.5, 0, 0.5, 0)
- Roundify.Selectable = true
- Roundify.Size = UDim2.new(1, 0, 1, 0)
- Roundify.Image = "rbxassetid://3570695787"
- Roundify.ImageColor3 = Color3.fromRGB(74, 74, 74)
- Roundify.ScaleType = Enum.ScaleType.Slice
- Roundify.SliceCenter = Rect.new(100, 100, 100, 100)
- Roundify.SliceScale = 0.060
- return Button
- elseif Class == "TextBox" then
- local TextBox = Instance.new("TextBox")
- local Roundify = Instance.new("ImageLabel")
- TextBox.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
- TextBox.BackgroundTransparency = 1.000
- TextBox.BorderSizePixel = 0
- TextBox.Size = UDim2.new(1, 0, 0, 30)
- TextBox.ZIndex = 2
- TextBox.Font = Enum.Font.GothamSemibold
- TextBox.PlaceholderText = "Text"
- TextBox.Text = ""
- TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- TextBox.TextSize = 14.000
- Roundify.Name = "Roundify"
- Roundify.Parent = TextBox
- Roundify.Active = true
- Roundify.AnchorPoint = Vector2.new(0.5, 0.5)
- Roundify.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Roundify.BackgroundTransparency = 1.000
- Roundify.Position = UDim2.new(0.5, 0, 0.5, 0)
- Roundify.Selectable = true
- Roundify.Size = UDim2.new(1, 0, 1, 0)
- Roundify.Image = "rbxassetid://3570695787"
- Roundify.ImageColor3 = Color3.fromRGB(74, 74, 74)
- Roundify.ScaleType = Enum.ScaleType.Slice
- Roundify.SliceCenter = Rect.new(100, 100, 100, 100)
- Roundify.SliceScale = 0.060
- return TextBox
- elseif Class == "Toggle" then
- local Toggle = Instance.new("TextButton")
- local Title = Instance.new("TextLabel")
- local Frame = Instance.new("ImageLabel")
- local Checkmark = Instance.new("TextLabel")
- Toggle.Name = "Toggle"
- Toggle.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
- Toggle.BackgroundTransparency = 1.000
- Toggle.BorderSizePixel = 0
- Toggle.Position = UDim2.new(0, 0, 0.129380047, 0)
- Toggle.Size = UDim2.new(1, 0, 0, 30)
- Toggle.ZIndex = 2
- Toggle.Font = Enum.Font.GothamSemibold
- Toggle.Text = ""
- Toggle.TextColor3 = Color3.fromRGB(255, 255, 255)
- Toggle.TextSize = 14.000
- Title.Name = "Title"
- Title.Parent = Toggle
- Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Title.BackgroundTransparency = 1.000
- Title.Position = UDim2.new(0, 8, 0, 0)
- Title.Size = UDim2.new(1, -38, 1, 0)
- Title.Font = Enum.Font.GothamSemibold
- Title.Text = "Toggle"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextSize = 14.000
- Title.TextXAlignment = Enum.TextXAlignment.Left
- Frame.Name = "Frame"
- Frame.Parent = Toggle
- Frame.AnchorPoint = Vector2.new(1, 0)
- Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Frame.BackgroundTransparency = 1.000
- Frame.Position = UDim2.new(1, 0, 0, 0)
- Frame.Size = UDim2.new(0, 30, 0, 30)
- Frame.Image = "rbxassetid://3570695787"
- Frame.ImageColor3 = Color3.fromRGB(74, 74, 74)
- Frame.ScaleType = Enum.ScaleType.Slice
- Frame.SliceCenter = Rect.new(100, 100, 100, 100)
- Frame.SliceScale = 0.060
- Checkmark.Name = "Checkmark"
- Checkmark.Parent = Frame
- Checkmark.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Checkmark.BackgroundTransparency = 1.000
- Checkmark.Size = UDim2.new(1, 0, 1, 0)
- Checkmark.Visible = true
- Checkmark.Font = Enum.Font.GothamSemibold
- Checkmark.Text = "✓"
- Checkmark.TextColor3 = Color3.fromRGB(33, 181, 33)
- Checkmark.TextSize = 18.000
- Checkmark.ZIndex = 2
- return Toggle
- elseif Class == "Slider" then
- local Slider = Instance.new("TextButton")
- local Title = Instance.new("TextLabel")
- local SliderHolder = Instance.new("ImageLabel")
- local Value = Instance.new("TextLabel")
- local SliderBar = Instance.new("ImageLabel")
- Slider.Name = "Slider"
- Slider.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
- Slider.BackgroundTransparency = 1.000
- Slider.BorderSizePixel = 0
- Slider.Position = UDim2.new(0, 0, 0.129380047, 0)
- Slider.Size = UDim2.new(1, 0, 0, 30)
- Slider.ZIndex = 2
- Slider.Font = Enum.Font.GothamSemibold
- Slider.Text = ""
- Slider.TextColor3 = Color3.fromRGB(255, 255, 255)
- Slider.TextSize = 14.000
- Title.Name = "Title"
- Title.Parent = Slider
- Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Title.BackgroundTransparency = 1.000
- Title.Position = UDim2.new(0, 8, 0, 0)
- Title.Size = UDim2.new(0.5, -8, 1, 0)
- Title.Font = Enum.Font.GothamSemibold
- Title.Text = "Slider"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextSize = 14.000
- Title.TextXAlignment = Enum.TextXAlignment.Left
- SliderHolder.Name = "SliderHolder"
- SliderHolder.Parent = Slider
- SliderHolder.AnchorPoint = Vector2.new(1, 0)
- SliderHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- SliderHolder.BackgroundTransparency = 1.000
- SliderHolder.Position = UDim2.new(1, 0, 0, 0)
- SliderHolder.Size = UDim2.new(0.5, 0, 0, 30)
- SliderHolder.Image = "rbxassetid://3570695787"
- SliderHolder.ImageColor3 = Color3.fromRGB(74, 74, 74)
- SliderHolder.ScaleType = Enum.ScaleType.Slice
- SliderHolder.SliceCenter = Rect.new(100, 100, 100, 100)
- SliderHolder.SliceScale = 0.060
- Value.Name = "Value"
- Value.Parent = SliderHolder
- Value.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Value.BackgroundTransparency = 1.000
- Value.Size = UDim2.new(1, 0, 1, 0)
- Value.ZIndex = 3
- Value.Font = Enum.Font.Gotham
- Value.Text = "50"
- Value.TextColor3 = Color3.fromRGB(255, 255, 255)
- Value.TextSize = 14.000
- SliderBar.Name = "SliderBar"
- SliderBar.Parent = SliderHolder
- SliderBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- SliderBar.BackgroundTransparency = 1.000
- SliderBar.Size = UDim2.new(0.5, 0, 1, 0)
- SliderBar.Image = "rbxassetid://3570695787"
- SliderBar.ImageColor3 = Color3.fromRGB(74, 74, 74)
- SliderBar.ScaleType = Enum.ScaleType.Slice
- SliderBar.SliceCenter = Rect.new(100, 100, 100, 100)
- SliderBar.SliceScale = 0.060
- return Slider
- elseif Class == "Dropdown" then
- local Dropdown = Instance.new("TextButton")
- local Title = Instance.new("TextLabel")
- local DropdownHolder = Instance.new("ImageLabel")
- local Value = Instance.new("TextLabel")
- local Minimize = Instance.new("ImageButton")
- local DropdownOptions = Instance.new("ImageLabel")
- local Content = Instance.new("ScrollingFrame")
- local UIListLayout = Instance.new("UIListLayout")
- local Button = Instance.new("TextButton")
- Dropdown.Name = "Dropdown"
- Dropdown.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
- Dropdown.BackgroundTransparency = 1.000
- Dropdown.BorderSizePixel = 0
- Dropdown.Position = UDim2.new(0, 0, 0.129380047, 0)
- Dropdown.Size = UDim2.new(1, 0, 0, 30)
- Dropdown.ZIndex = 5
- Dropdown.Font = Enum.Font.GothamSemibold
- Dropdown.Text = ""
- Dropdown.TextColor3 = Color3.fromRGB(255, 255, 255)
- Dropdown.TextSize = 14.000
- Title.Name = "Title"
- Title.Parent = Dropdown
- Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Title.BackgroundTransparency = 1.000
- Title.Position = UDim2.new(0, 8, 0, 0)
- Title.Size = UDim2.new(0.5, -8, 1, 0)
- Title.Font = Enum.Font.GothamSemibold
- Title.Text = "Dropdown"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextSize = 14.000
- Title.TextXAlignment = Enum.TextXAlignment.Left
- Title.ZIndex = 4
- DropdownHolder.Name = "DropdownHolder"
- DropdownHolder.Parent = Dropdown
- DropdownHolder.AnchorPoint = Vector2.new(1, 0)
- DropdownHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- DropdownHolder.BackgroundTransparency = 1.000
- DropdownHolder.Position = UDim2.new(1, 0, 0, 0)
- DropdownHolder.Size = UDim2.new(0.5, 0, 0, 30)
- DropdownHolder.Image = "rbxassetid://3570695787"
- DropdownHolder.ImageColor3 = Color3.fromRGB(74, 74, 74)
- DropdownHolder.ScaleType = Enum.ScaleType.Slice
- DropdownHolder.SliceCenter = Rect.new(100, 100, 100, 100)
- DropdownHolder.SliceScale = 0.060
- DropdownHolder.ZIndex = 4
- Value.Name = "Value"
- Value.Parent = DropdownHolder
- Value.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Value.BackgroundTransparency = 1.000
- Value.Position = UDim2.new(0, 3, 0, 0)
- Value.Size = UDim2.new(1, -30, 1, 0)
- Value.Font = Enum.Font.Gotham
- Value.Text = "Button"
- Value.TextColor3 = Color3.fromRGB(255, 255, 255)
- Value.TextSize = 14.000
- Value.ZIndex = 6
- Minimize.Name = "Minimize"
- Minimize.Parent = DropdownHolder
- Minimize.AnchorPoint = Vector2.new(1, 0)
- Minimize.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Minimize.BackgroundTransparency = 1.000
- Minimize.Position = UDim2.new(1, -3, 0, 3)
- Minimize.Size = UDim2.new(0, 24, 0, 24)
- Minimize.Image = "rbxassetid://4954699658"
- Minimize.ZIndex = 6
- DropdownOptions.Name = "DropdownOptions"
- DropdownOptions.Parent = DropdownHolder
- DropdownOptions.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- DropdownOptions.BackgroundTransparency = 1.000
- DropdownOptions.Size = UDim2.new(1, 0, 0, 30)
- DropdownOptions.Image = "rbxassetid://3570695787"
- DropdownOptions.ImageColor3 = Color3.fromRGB(74, 74, 74)
- DropdownOptions.ScaleType = Enum.ScaleType.Slice
- DropdownOptions.SliceCenter = Rect.new(100, 100, 100, 100)
- DropdownOptions.SliceScale = 0.060
- DropdownOptions.ClipsDescendants = true
- DropdownOptions.ZIndex = 4
- Content.Name = "Content"
- Content.Parent = DropdownOptions
- Content.Active = true
- Content.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Content.BackgroundTransparency = 1.000
- Content.BorderSizePixel = 0
- Content.Position = UDim2.new(0, 0, 0, 30)
- Content.Size = UDim2.new(1, 0, 1, -30)
- Content.BottomImage = "rbxassetid://6347925"
- Content.CanvasSize = UDim2.new(0, 0, 0, 0)
- Content.MidImage = "rbxassetid://6347925"
- Content.ScrollBarThickness = 3
- Content.TopImage = "rbxassetid://6347925"
- Content.ZIndex = 4
- UIListLayout.Parent = Content
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- return Dropdown
- elseif Class == "DropdownOption" then
- local Button = Instance.new("TextButton")
- Button.Name = "Button"
- Button.BackgroundColor3 = Color3.fromRGB(74, 74, 74)
- Button.BackgroundTransparency = 1.000
- Button.BorderSizePixel = 0
- Button.Position = UDim2.new(0, 0, 0.129380047, 0)
- Button.Size = UDim2.new(1, 0, 0, 20)
- Button.ZIndex = 5
- Button.Font = Enum.Font.Gotham
- Button.TextColor3 = Color3.fromRGB(215, 215, 215)
- Button.TextSize = 14.000
- return Button
- elseif Class == "Window" then
- xThing = xThing + 0.125
- if xThing > 0.625 then
- xThing = 0.125
- yThing = yThing + 0.35
- end
- local Keylime = Instance.new("ScreenGui")
- local MainFrame = Instance.new("ImageLabel")
- local Decor = Instance.new("Folder")
- local Line = Instance.new("ImageLabel")
- local Logo = Instance.new("TextLabel")
- local Minimize = Instance.new("ImageButton")
- local Content = Instance.new("ScrollingFrame")
- local UIListLayout = Instance.new("UIListLayout")
- local UIPadding = Instance.new("UIPadding")
- Keylime.Name = "Keylime"
- Keylime.ResetOnSpawn = false
- if RunService:IsStudio() then
- Keylime.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
- else
- Keylime.Parent = game:GetService("CoreGui")
- end
- MainFrame.Name = "MainFrame"
- MainFrame.Parent = Keylime
- MainFrame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
- MainFrame.BackgroundTransparency = 1.000
- MainFrame.BorderColor3 = Color3.fromRGB(27, 42, 53)
- MainFrame.Position = UDim2.new(xThing, 0, yThing, 0)
- MainFrame.Size = UDim2.new(0, 200, 0, 375)
- MainFrame.Image = "rbxassetid://3570695787"
- MainFrame.ImageColor3 = Color3.fromRGB(35, 35, 35)
- MainFrame.ScaleType = Enum.ScaleType.Slice
- MainFrame.SliceCenter = Rect.new(100, 100, 100, 100)
- MainFrame.SliceScale = 0.120
- Decor.Name = "Decor"
- Decor.Parent = MainFrame
- Line.Name = "Line"
- Line.Parent = Decor
- Line.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Line.BorderSizePixel = 0
- Line.Position = UDim2.new(0, 0, 0, 30)
- Line.Size = UDim2.new(1, 0, 0, 7)
- Line.Image = "rbxassetid://2790390993"
- Line.ImageColor3 = Color3.fromRGB(33, 181, 33)
- Logo.Name = "Title"
- Logo.Parent = Decor
- Logo.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Logo.BackgroundTransparency = 1.000
- Logo.BorderSizePixel = 0
- Logo.Size = UDim2.new(1, 0, 0, 30)
- Logo.Font = Enum.Font.GothamSemibold
- Logo.Text = "Keylime Hub"
- Logo.TextColor3 = Color3.fromRGB(226, 226, 226)
- Logo.TextSize = 14.000
- Minimize.Name = "Minimize"
- Minimize.Parent = MainFrame
- Minimize.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Minimize.BackgroundTransparency = 1.000
- Minimize.Position = UDim2.new(0, 3, 0, 3)
- Minimize.Size = UDim2.new(0, 24, 0, 24)
- Minimize.Image = "rbxassetid://4954699658"
- Content.Name = "Content"
- Content.Parent = MainFrame
- Content.Active = true
- Content.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Content.BackgroundTransparency = 1.000
- Content.BorderSizePixel = 0
- Content.Position = UDim2.new(0, 0, 0, 37)
- Content.Size = UDim2.new(1, 0, 1, -37)
- Content.BottomImage = "rbxassetid://6347925"
- Content.CanvasSize = UDim2.new(0, 0, 0, 0)
- Content.MidImage = "rbxassetid://6347925"
- Content.ScrollBarThickness = 3
- Content.TopImage = "rbxassetid://6347925"
- Content.VerticalScrollBarInset = Enum.ScrollBarInset.None
- UIListLayout.Parent = Content
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- UIListLayout.Padding = UDim.new(0, 4)
- UIPadding.Parent = Content
- UIPadding.PaddingLeft = UDim.new(0, 4)
- UIPadding.PaddingRight = UDim.new(0, 4)
- UIPadding.PaddingTop = UDim.new(0, 4)
- return Keylime
- end
- end
- local function AnimateButton(Object, LinkedObject)
- local BaseColor
- local Image = false
- if not LinkedObject then
- if Object:IsA("ImageButton") then
- BaseColor = Object.ImageColor3
- Image = true
- else
- BaseColor = Object.BackgroundColor3
- end
- Object.MouseEnter:Connect(function()
- if Image then
- TweenService:Create(Object, TweenInfo.new(0.2), {
- ImageColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
- }):Play()
- else
- TweenService:Create(Object, TweenInfo.new(0.2), {
- BackgroundColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
- }):Play()
- end
- end)
- Object.MouseLeave:Connect(function()
- if Image then
- TweenService:Create(Object, TweenInfo.new(0.2), {
- ImageColor3 = BaseColor
- }):Play()
- else
- TweenService:Create(Object, TweenInfo.new(0.2), {
- BackgroundColor3 = BaseColor
- }):Play()
- end
- end)
- Object.MouseButton1Down:Connect(function()
- if Image then
- TweenService:Create(Object, TweenInfo.new(0.2), {
- ImageColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
- }):Play()
- else
- TweenService:Create(Object, TweenInfo.new(0.2), {
- BackgroundColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
- }):Play()
- end
- end)
- Object.MouseButton1Up:Connect(function()
- if Image then
- TweenService:Create(Object, TweenInfo.new(0.2), {
- ImageColor3 = BaseColor
- }):Play()
- else
- TweenService:Create(Object, TweenInfo.new(0.2), {
- BackgroundColor3 = BaseColor
- }):Play()
- end
- end)
- elseif Object:IsA("TextBox") then
- if LinkedObject:IsA("ImageButton") or LinkedObject:IsA("ImageLabel") then
- BaseColor = LinkedObject.ImageColor3
- Image = true
- else
- BaseColor = LinkedObject.BackgroundColor3
- end
- local Focused = false
- Object.MouseEnter:Connect(function()
- if not Focused then
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
- }):Play()
- end
- end
- end)
- Object.MouseLeave:Connect(function()
- if Focused then
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = BaseColor
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = BaseColor
- }):Play()
- end
- end
- end)
- Object.Focused:Connect(function()
- Focused = true
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
- }):Play()
- end
- end)
- Object.FocusLost:Connect(function()
- Focused = false
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = BaseColor
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = BaseColor
- }):Play()
- end
- end)
- else
- if LinkedObject:IsA("ImageButton") or LinkedObject:IsA("ImageLabel") then
- BaseColor = LinkedObject.ImageColor3
- Image = true
- else
- BaseColor = LinkedObject.BackgroundColor3
- end
- Object.MouseEnter:Connect(function()
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
- }):Play()
- end
- end)
- Object.MouseLeave:Connect(function()
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = BaseColor
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = BaseColor
- }):Play()
- end
- end)
- Object.MouseButton1Down:Connect(function()
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
- }):Play()
- end
- end)
- Object.MouseButton1Up:Connect(function()
- if Image then
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- ImageColor3 = BaseColor
- }):Play()
- else
- TweenService:Create(LinkedObject, TweenInfo.new(0.2), {
- BackgroundColor3 = BaseColor
- }):Play()
- end
- end)
- end
- end
- function KeylimeLibrary.new(Title)
- if not Title then Title = "Keylime Hub" end
- local Keylime = {}
- Keylime.Frame = CreateBaseObject("Window")
- Keylime.Opened = true
- local KeylimeMainFrame = Keylime.Frame.MainFrame
- local CanDrag = false
- local Dragging = false
- local MouseOffset
- AnimateButton(KeylimeMainFrame.Minimize)
- KeylimeMainFrame.Decor.Title.Text = Title
- KeylimeMainFrame.ClipsDescendants = true
- KeylimeMainFrame.Minimize.MouseButton1Down:Connect(function()
- Keylime.Opened = not Keylime.Opened
- if Keylime.Opened then
- KeylimeMainFrame:TweenSize(UDim2.new(0, 200, 0, math.clamp(KeylimeMainFrame.Content.UIListLayout.AbsoluteContentSize.Y + 45, 0, 350)), "Out", "Sine", 0.3, true)
- TweenService:Create(KeylimeMainFrame.Minimize, TweenInfo.new(0.3), {Rotation = 0}):Play()
- else
- KeylimeMainFrame:TweenSize(UDim2.new(0, 200, 0, 37), "Out", "Sine", 0.3, true)
- TweenService:Create(KeylimeMainFrame.Minimize, TweenInfo.new(0.3), {Rotation = 180}):Play()
- end
- end)
- KeylimeMainFrame.Decor.Title.MouseEnter:Connect(function()
- CanDrag = true
- end)
- KeylimeMainFrame.Decor.Title.MouseLeave:Connect(function()
- CanDrag = false
- end)
- local function DragLoop()
- while MouseOffset and Dragging do
- wait()
- KeylimeMainFrame:TweenPosition(UDim2.new(0, Mouse.X - MouseOffset.X, 0, Mouse.Y - MouseOffset.Y), "Out", "Sine", 0.1, true)
- end
- KeylimeMainFrame:TweenPosition(UDim2.new(0, Mouse.X - MouseOffset.X, 0, Mouse.Y - MouseOffset.Y), "Out", "Sine", 0.1, true)
- MouseOffset = nil
- end
- UserInputService.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- if CanDrag then
- MouseOffset = {X = Mouse.X - KeylimeMainFrame.AbsolutePosition.X, Y = Mouse.Y - KeylimeMainFrame.AbsolutePosition.Y}
- Dragging = true
- DragLoop()
- end
- end
- end)
- UserInputService.InputEnded:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- if Dragging then
- Dragging = false
- end
- end
- end)
- KeylimeMainFrame.Content.UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
- KeylimeMainFrame.Size = UDim2.new(0, 200, 0, math.clamp(KeylimeMainFrame.Content.UIListLayout.AbsoluteContentSize.Y + 45, 0, 350))
- KeylimeMainFrame.Content.CanvasSize = UDim2.new(0, 0, 0, KeylimeMainFrame.Content.UIListLayout.AbsoluteContentSize.Y + 4)
- end)
- function Keylime:Create(Class, Title, Callback, Metadata)
- if string.lower(Class) == "button" then
- local Button = CreateBaseObject("Button")
- AnimateButton(Button, Button.Roundify)
- Button.Text = Title or "Button"
- Button.Parent = KeylimeMainFrame.Content
- if Callback then
- Button.MouseButton1Click:Connect(function()
- pcall(Callback)
- end)
- end
- elseif string.lower(Class) == "toggle" then
- local Data = {}
- Data.Value = false
- if Metadata and Metadata.Default then
- Data.Value = Metadata.Default
- end
- local Toggle = CreateBaseObject("Toggle")
- AnimateButton(Toggle, Toggle.Frame)
- Toggle.Frame.Checkmark.TextTransparency = Data.Value and 0 or 1
- Toggle.Title.Text = Title or "Toggle"
- Toggle.Parent = KeylimeMainFrame.Content
- Toggle.MouseButton1Click:Connect(function()
- Data.Value = not Data.Value
- TweenService:Create(Toggle.Frame.Checkmark, TweenInfo.new(0.2), {TextTransparency = Data.Value and 0 or 1}):Play()
- if Callback then
- pcall(Callback, Data.Value)
- end
- end)
- elseif string.lower(Class) == "slider" then
- local Data = {}
- Data.Value = 0
- Data.MinValue = 0
- Data.MaxValue = 1
- if Metadata then
- if Metadata.Default then
- Data.Value = Metadata.Default
- end
- if Metadata.MinValue then
- Data.MinValue = Metadata.MinValue
- end
- if Metadata.MaxValue then
- Data.MaxValue = Metadata.MaxValue
- end
- end
- local Slider = CreateBaseObject("Slider")
- AnimateButton(Slider, Slider.SliderHolder)
- Slider.Title.Text = Title or "Slider"
- Slider.SliderHolder.Value.Text = math.clamp(Data.Value, Data.MinValue, Data.MaxValue)
- Slider.SliderHolder.SliderBar.Size = UDim2.new(math.clamp(Data.Value / Data.MaxValue, 0, 1), 0, 1, 0)
- Slider.Parent = KeylimeMainFrame.Content
- local CurrentAnchor
- local Break = false
- local function MouseLoop()
- local Difference = 0
- while CurrentAnchor do
- wait()
- if Break == true then Break = false break end
- Difference = (Mouse.X - CurrentAnchor) / Slider.SliderHolder.AbsoluteSize.X
- Slider.SliderHolder.Value.Text = math.floor(math.clamp(Data.Value + (Difference * Slider.SliderHolder.AbsoluteSize.X), Data.MinValue, Data.MaxValue))
- Slider.SliderHolder.SliderBar.Size = UDim2.new((math.clamp((Data.Value + (Difference * Slider.SliderHolder.AbsoluteSize.X)) / Data.MaxValue, 0, 1)), 0, 1, 0)
- end
- Data.Value = math.clamp(Data.Value + (Difference * Slider.SliderHolder.AbsoluteSize.X), Data.MinValue, Data.MaxValue)
- end
- Slider.MouseButton1Down:Connect(function()
- Break = false
- CurrentAnchor = Mouse.X
- MouseLoop()
- end)
- UserInputService.InputEnded:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- if not Break and CurrentAnchor then
- CurrentAnchor = nil
- Break = true
- if Callback then
- wait() wait()
- pcall(Callback, Data.Value)
- end
- end
- end
- end)
- Mouse.Button1Up:Connect(function()
- if not Break and CurrentAnchor then
- CurrentAnchor = nil
- Break = true
- if Callback then
- wait() wait()
- pcall(Callback, Data.Value)
- end
- end
- end)
- elseif string.lower(Class) == "textbox" then
- local Data = {}
- Data.Value = ""
- if Metadata then
- if Metadata.Default then
- Data.Value = Metadata.Default
- end
- end
- local TextBox = CreateBaseObject("TextBox")
- AnimateButton(TextBox, TextBox.Roundify)
- TextBox.PlaceholderText = Title
- TextBox.Text = Data.Value
- TextBox.Parent = KeylimeMainFrame.Content
- TextBox.FocusLost:Connect(function()
- Data.Value = TextBox.Text
- pcall(Callback, Data.Value)
- end)
- elseif string.lower(Class) == "dropdown" then
- local Data = {}
- Data.Value = ""
- Data.Options = {}
- if Metadata then
- if Metadata.Default then
- Data.Value = Metadata.Default
- end
- if Metadata.Options and type(Metadata.Options) == "table" then
- Data.Options = Metadata.Options
- end
- end
- local Dropped = false
- local Dropdown = CreateBaseObject("Dropdown")
- AnimateButton(Dropdown, Dropdown.DropdownHolder.DropdownOptions)
- Dropdown.Title.Text = Title
- Dropdown.DropdownHolder.Value.Text = Data.Value
- local function AnimateDropdown(Status)
- if Status then
- local DropdownOptions = Dropdown.DropdownHolder.DropdownOptions
- TweenService:Create(Dropdown.DropdownHolder.Minimize, TweenInfo.new(0.3), {Rotation = 180}):Play()
- DropdownOptions:TweenSize(UDim2.new(1,0,0,math.clamp(DropdownOptions.Content.UIListLayout.AbsoluteContentSize.Y + 30, 0, 150)), "Out", "Sine", 0.15, true)
- else
- local DropdownOptions = Dropdown.DropdownHolder.DropdownOptions
- TweenService:Create(Dropdown.DropdownHolder.Minimize, TweenInfo.new(0.3), {Rotation = 0}):Play()
- DropdownOptions:TweenSize(UDim2.new(1,0,0,math.clamp(30, 0, 150)), "Out", "Sine", 0.15, true)
- end
- end
- for _, Option in next, Data.Options do
- local DropdownOption = CreateBaseObject("DropdownOption")
- DropdownOption.Text = tostring(Option)
- DropdownOption.Parent = Dropdown.DropdownHolder.DropdownOptions.Content
- local BaseColor = DropdownOption.TextColor3
- DropdownOption.MouseEnter:Connect(function()
- TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
- TextColor3 = Color3.new(BaseColor.R * 1.1, BaseColor.G * 1.1, BaseColor.B * 1.1)
- }):Play()
- end)
- DropdownOption.MouseLeave:Connect(function()
- TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
- TextColor3 = BaseColor
- }):Play()
- end)
- DropdownOption.MouseButton1Down:Connect(function()
- TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
- TextColor3 = Color3.new(BaseColor.R * 0.8, BaseColor.G * 0.8, BaseColor.B * 0.8)
- }):Play()
- end)
- DropdownOption.MouseButton1Up:Connect(function()
- TweenService:Create(DropdownOption, TweenInfo.new(0.2), {
- TextColor3 = BaseColor
- }):Play()
- end)
- DropdownOption.MouseButton1Click:Connect(function()
- if Dropped then
- Dropped = false
- Data.Value = Option
- Dropdown.DropdownHolder.Value.Text = Data.Value
- AnimateDropdown(false)
- if Callback then
- pcall(Callback, Data.Value)
- end
- end
- end)
- Dropdown.DropdownHolder.DropdownOptions.Content.CanvasSize = UDim2.new(0, 0, 0, Dropdown.DropdownHolder.DropdownOptions.Content.UIListLayout.AbsoluteContentSize.Y)
- end
- Dropdown.MouseButton1Click:Connect(function()
- Dropped = not Dropped
- AnimateDropdown(Dropped)
- end)
- Dropdown.DropdownHolder.Minimize.MouseButton1Click:Connect(function()
- Dropped = not Dropped
- AnimateDropdown(Dropped)
- end)
- Dropdown.Parent = KeylimeMainFrame.Content
- end
- end
- return Keylime
- end
- return KeylimeLibrary
Add Comment
Please, Sign In to add comment