Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local library = {}
- local ts = game:GetService("TweenService")
- function library:Create(clips, title, key_toggle)
- if not title then
- title = "FlatUI"
- end
- if not key_toggle then
- key_toggle = "Q"
- end
- local new_gui = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
- new_gui.Name = title
- new_gui.ResetOnSpawn = false
- new_gui.ZIndexBehavior = Enum.ZIndexBehavior.Global
- local container = Instance.new("Frame")
- local main = Instance.new("Frame")
- local options = Instance.new("Frame")
- local alert_container = Instance.new("Frame")
- alert_container.Name = "Alerts"
- alert_container.Parent = new_gui
- alert_container.BackgroundTransparency = 1
- alert_container.Size = UDim2.new(0, 600, 0, 300)
- alert_container.Position = UDim2.new(0.5, -300, 1, -150)
- local ALERTLIST = Instance.new("UIListLayout", alert_container)
- ALERTLIST.Parent = alert_container
- ALERTLIST.SortOrder = Enum.SortOrder.LayoutOrder
- ALERTLIST.Padding = UDim.new(0, 0)
- container.Name = "Container"
- container.Parent = new_gui
- container.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- container.BorderSizePixel = 0
- container.Size = UDim2.new(0, 600, 0, 350)
- container.Position = UDim2.new(0.5, -(300), 0.5, -(175))
- container.ClipsDescendants = clips
- local name_label = Instance.new("TextLabel", container)
- name_label.Name = "Title"
- name_label.BackgroundTransparency = 1
- name_label.Size = UDim2.new(1, 0, 0, 35)
- name_label.Font = Enum.Font.SourceSans
- name_label.Text = " " .. title
- name_label.TextColor3 = Color3.fromRGB(255, 255, 255)
- name_label.TextSize = 20
- name_label.TextXAlignment = Enum.TextXAlignment.Left
- name_label.ZIndex = 10
- local name_bar = Instance.new("Frame", name_label)
- name_bar.Name = "ColourBar"
- name_bar.BackgroundColor3 = Color3.fromRGB(165, 155, 255)
- name_bar.BorderSizePixel = 0
- name_bar.Size = UDim2.new(0, 4, 0, 25)
- name_bar.Position = UDim2.new(0, 0, 0, 5)
- name_bar.ZIndex = 9
- options.Name = "Options"
- options.Parent = container
- options.BackgroundColor3 = Color3.fromRGB(56, 56, 56)
- options.BorderSizePixel = 0
- options.Position = UDim2.new(0, 0, 0, 35)
- options.Size = UDim2.new(0, 135, 0, 315)
- local dragging = false
- local in_view = false
- local last_mousex
- local last_mousey
- spawn(function()
- name_label.MouseEnter:Connect(function()
- in_view = true
- end)
- name_label.MouseLeave:Connect(function()
- in_view = false
- end)
- local mouse = game.Players.LocalPlayer:GetMouse()
- mouse.Button1Down:Connect(function()
- if in_view then
- dragging = true
- last_mousex = mouse.X
- last_mousey = mouse.Y
- while dragging do
- container.Position = container.Position + UDim2.new(0, (mouse.X - last_mousex), 0, (mouse.Y - last_mousey))
- last_mousex = mouse.X
- last_mousey = mouse.Y
- wait()
- end
- end
- end)
- mouse.Button1Up:Connect(function()
- if in_view then
- dragging = false
- end
- end)
- end)
- local minimised = false
- local close_button = Instance.new("ImageButton", name_label)
- close_button.Name = "Close"
- close_button.BackgroundTransparency = 1
- close_button.Position = UDim2.new(0.95, 0, 0.5, -(5))
- close_button.Size = UDim2.new(0, 10, 0, 10)
- close_button.Image = "rbxassetid://3570695787"
- close_button.ImageColor3 = Color3.fromRGB(255, 110, 110)
- local mini_button = Instance.new("ImageButton", name_label)
- mini_button.Name = "Minimise"
- mini_button.BackgroundTransparency = 1
- mini_button.Position = UDim2.new(0.905, 0, 0.5, -(5))
- mini_button.Size = UDim2.new(0, 10, 0, 10)
- mini_button.Image = "rbxassetid://3570695787"
- mini_button.ImageColor3 = Color3.fromRGB(255, 185, 65)
- mini_button.MouseButton1Click:Connect(function()
- minimised = not minimised
- if minimised then
- container.ClipsDescendants = true
- local tween_info = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
- container:TweenSize(UDim2.new(0, 600, 0, 35), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
- local tween = ts:Create(mini_button, tween_info, {ImageColor3 = Color3.fromRGB(160, 255, 165)})
- wait(0.5)
- tween:Play()
- else
- local tween_info = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
- container:TweenSize(UDim2.new(0, 600, 0, 350), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
- local tween = ts:Create(mini_button, tween_info, {ImageColor3 = Color3.fromRGB(255, 185, 65)})
- wait(0.5)
- tween:Play()
- container.ClipsDescendants = clips
- end
- end)
- close_button.MouseButton1Click:Connect(function()
- new_gui:Destroy()
- end)
- main.Name = "Main"
- main.Parent = container
- main.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
- main.BorderSizePixel = 0
- main.Position = UDim2.new(0, 140, 0, 35)
- main.Size = UDim2.new(0, 460, 0, 315)
- local UILIST = Instance.new("UIListLayout")
- UILIST.Parent = options
- UILIST.SortOrder = Enum.SortOrder.LayoutOrder
- UILIST.Padding = UDim.new(0.01, 0)
- local toggle = false
- local input = false
- game:GetService("UserInputService").InputEnded:Connect(function(key)
- if key.KeyCode == Enum.KeyCode[key_toggle] and not input then
- toggle = not toggle
- if toggle then
- container:TweenPosition(container.Position + UDim2.new(0, 0, 2, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5, true)
- else
- container:TweenPosition(container.Position + UDim2.new(0, 0, -2, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.5, true)
- end
- end
- end)
- local options_lib = {}
- local n_options = 0
- function options_lib:AddOption(option)
- local new_button = Instance.new("TextButton", options)
- new_button.BackgroundTransparency = 1
- new_button.Size = UDim2.new(1, 0, 0, 30)
- new_button.Font = Enum.Font.SourceSans
- new_button.Text = " " .. tostring(option)
- new_button.TextColor3 = Color3.fromRGB(255, 255, 255)
- new_button.TextSize = 20
- new_button.TextXAlignment = Enum.TextXAlignment.Left
- local button_effect = Instance.new("Frame", new_button)
- button_effect.Name = "Effect"
- button_effect.Size = UDim2.new(0, 4, 1, 0)
- button_effect.Position = UDim2.new(0, 0, 0, 0)
- button_effect.Visible = false
- button_effect.BorderSizePixel = 0
- button_effect.BackgroundColor3 = Color3.fromRGB(165, 155, 255)
- new_button.MouseButton1Click:Connect(function()
- for i,v in pairs(new_gui.Container.Main:GetChildren()) do
- v.Visible = false
- end
- for i,v in pairs(new_gui.Container.Options:GetChildren()) do
- if v:IsA("TextButton") then
- v.Effect.Visible = false
- end
- end
- new_gui.Container.Main[option].Visible = true
- button_effect.Visible = true
- for i = 1, 0, -0.1 do
- button_effect.BackgroundTransparency = i
- wait()
- end
- end)
- local new_frame = Instance.new("Frame", main)
- if n_options == 0 then
- new_frame.Visible = true
- button_effect.Visible = true
- else
- new_frame.Visible = false
- button_effect.Visible = false
- end
- n_options = n_options + 1
- new_frame.Name = option
- new_frame.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
- new_frame.BorderSizePixel = 0
- new_frame.Size = main.Size
- local list_layout = Instance.new("UIListLayout", main[option])
- local ui_padding = Instance.new("UIPadding", main[option])
- list_layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- list_layout.SortOrder = Enum.SortOrder.LayoutOrder
- list_layout.Padding = UDim.new(0.03, 0)
- ui_padding.PaddingTop = UDim.new(0.03, 0)
- local cheats_lib = {}
- function cheats_lib:AddLabel(text)
- local new_label = Instance.new("TextLabel", new_frame)
- new_label.Name = "JustALabel"
- new_label.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- new_label.BorderSizePixel = 0
- new_label.Size = UDim2.new(0.95, 0, 0, 20)
- new_label.Font = Enum.Font.SourceSans
- new_label.Text = text
- new_label.TextColor3 = Color3.fromRGB(255, 255, 255)
- new_label.TextSize = 18
- new_label.TextXAlignment = Enum.TextXAlignment.Center
- new_label.ClipsDescendants = true
- end
- function cheats_lib:AddHeader(text)
- local new_label = Instance.new("TextLabel", new_frame)
- new_label.Name = "JustALabel"
- new_label.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- new_label.BorderSizePixel = 0
- new_label.Size = UDim2.new(0.95, 0, 0, 30)
- new_label.Font = Enum.Font.SourceSans
- new_label.Text = text
- new_label.TextColor3 = Color3.fromRGB(255, 255, 255)
- new_label.TextSize = 20
- new_label.TextXAlignment = Enum.TextXAlignment.Center
- new_label.ClipsDescendants = true
- end
- function cheats_lib:AddButton(name, callback)
- local button_container = Instance.new("TextButton", new_frame)
- button_container.Name = string.gsub(name, " ", "").."BTN"
- button_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- button_container.BorderSizePixel = 0
- button_container.Size = UDim2.new(0.95, 0, 0, 20)
- button_container.Font = Enum.Font.SourceSans
- button_container.Text = name
- button_container.TextColor3 = Color3.fromRGB(255, 255, 255)
- button_container.TextSize = 18
- button_container.TextXAlignment = Enum.TextXAlignment.Center
- button_container.ClipsDescendants = true
- button_container.MouseButton1Click:Connect(callback)
- end
- function cheats_lib:AddToggle(title, state, callback)
- local button_container = Instance.new("TextButton", new_frame)
- button_container.Name = string.gsub(title, " ", "").."TGL"
- button_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- button_container.BorderSizePixel = 0
- button_container.Size = UDim2.new(0.95, 0, 0, 20)
- button_container.Font = Enum.Font.SourceSans
- button_container.Text = title
- button_container.TextColor3 = Color3.fromRGB(255, 255, 255)
- button_container.TextSize = 18
- local toggle_track = Instance.new("Frame", button_container)
- toggle_track.Name = "ToggleEffect"
- toggle_track.BackgroundColor3 = Color3.fromRGB(255, 75, 75)
- toggle_track.BorderSizePixel = 0
- toggle_track.Position = UDim2.new(1, -16, 0, 4)
- toggle_track.Size = UDim2.new(0, 12, 0, 12)
- if state then
- toggle_track.BackgroundColor3 = Color3.fromRGB(185, 255, 20)
- else
- toggle_track.BackgroundColor3 = Color3.fromRGB(255, 75, 75)
- end
- button_container.MouseButton1Click:Connect(function()
- state = not state
- if state then
- toggle_track.BackgroundColor3 = Color3.fromRGB(185, 255, 20)
- callback(true)
- else
- toggle_track.BackgroundColor3 = Color3.fromRGB(255, 75, 75)
- callback(false)
- end
- end)
- end
- function cheats_lib:AddBox(title, default, placeholder, cleartext, callback)
- local box_container = Instance.new("Frame", new_frame)
- local new_label = Instance.new("TextLabel", box_container)
- local new_box = Instance.new("TextBox", box_container)
- box_container.Name = string.gsub(title, " ", "").."BOX"
- box_container.Size = UDim2.new(0.95, 0, 0, 20)
- box_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- box_container.BorderSizePixel = 0
- new_label.Text = " "..title..":"
- new_label.BackgroundTransparency = 1
- new_label.Size = UDim2.new(0.5, 0, 1, 0)
- new_label.Font = Enum.Font.SourceSansSemibold
- new_label.TextColor3 = Color3.fromRGB(255, 255, 255)
- new_label.TextSize = 18
- new_label.TextXAlignment = Enum.TextXAlignment.Left
- new_box.BackgroundColor3 = Color3.fromRGB(24, 24, 24)
- new_box.BorderSizePixel = 0
- new_box.Position = UDim2.new(0.5, 4, 0.2, 0)
- new_box.Size = UDim2.new(0.5, -8, 0.6, 0)
- new_box.Font = Enum.Font.SourceSansSemibold
- new_box.Text = default
- new_box.TextColor3 = Color3.fromRGB(255, 255, 255)
- new_box.TextSize = 15
- new_box.ClearTextOnFocus = cleartext
- new_box.Focused:Connect(function()
- input = true
- end)
- new_box.FocusLost:Connect(function()
- callback(new_box.Text)
- input = false
- end)
- end
- function cheats_lib:AddDropdown(name, options_table, callback)
- local open = false
- local d_container = Instance.new("Frame", new_frame)
- d_container.Name = string.gsub(name, " ", "").."DRP"
- d_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- d_container.BorderSizePixel = 0
- d_container.Size = UDim2.new(0.95, 0, 0, 20)
- local d_list = Instance.new("UIListLayout", d_container)
- d_list.HorizontalAlignment = Enum.HorizontalAlignment.Center
- d_list.Padding = UDim.new(0, 0)
- d_list.SortOrder = Enum.SortOrder.LayoutOrder
- local d_button = Instance.new("TextButton", d_container)
- d_button.BackgroundTransparency = 1
- d_button.Position = UDim2.new(0, 0, 0, 0)
- d_button.Size = UDim2.new(1, 0, 1, 0)
- d_button.Font = Enum.Font.SourceSansSemibold
- d_button.Text = name
- d_button.TextColor3 = Color3.fromRGB(255, 255, 255)
- d_button.TextSize = 18
- d_button.TextXAlignment = Enum.TextXAlignment.Center
- local d_status = Instance.new("ImageLabel", d_button)
- d_status.Image = "http://www.roblox.com/asset/?id=71659683"
- d_status.Size = UDim2.new(0, 12, 0, 12)
- d_status.Position = UDim2.new(0, 4, 0, 4)
- d_status.BackgroundTransparency = 1
- local d_frame = Instance.new("Frame", d_container)
- d_frame.Size = UDim2.new(1, 0, 0, 0)
- d_frame.BackgroundColor3 = Color3.fromRGB(42, 42, 42)
- d_frame.BorderSizePixel = 0
- d_frame.ClipsDescendants = true
- d_frame.ZIndex = 3
- local frame_layout = Instance.new("UIListLayout", d_frame)
- frame_layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- frame_layout.SortOrder = Enum.SortOrder.LayoutOrder
- for i,v in pairs(options_table) do
- local new_d_option = Instance.new("TextButton", d_frame)
- new_d_option.BorderSizePixel = 0
- new_d_option.Size = UDim2.new(1, 0, 0, 20)
- new_d_option.Font = Enum.Font.SourceSansSemibold
- new_d_option.Text = tostring(v)
- new_d_option.TextSize = 16
- new_d_option.TextColor3 = Color3.fromRGB(255, 255, 255)
- new_d_option.BackgroundTransparency = 1
- new_d_option.TextXAlignment = Enum.TextXAlignment.Center
- new_d_option.ZIndex = 3
- new_d_option.MouseButton1Click:Connect(function()
- callback(new_d_option.Text)
- end)
- end
- d_button.MouseButton1Click:Connect(function()
- open = not open
- if open then
- ts:Create(d_status, TweenInfo.new(0.5), {Rotation = 90}):Play()
- d_frame:TweenSize(UDim2.new(1, 0, 0, #options_table * 20), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
- else
- ts:Create(d_status, TweenInfo.new(0.5), {Rotation = 0}):Play()
- d_frame:TweenSize(UDim2.new(1, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.5, true)
- end
- end)
- end
- function cheats_lib:SendAlert(message, type_, wait_time)
- local alert_label = Instance.new("TextLabel", alert_container)
- alert_label.Size = UDim2.new(1, 0, 0, 30)
- alert_label.BackgroundColor3 = Color3.fromRGB(84, 84, 84)
- alert_label.BorderSizePixel = 0
- alert_label.Font = Enum.Font.SourceSansSemibold
- alert_label.Text = (" ")..message
- alert_label.TextXAlignment = Enum.TextXAlignment.Left
- alert_label.TextColor3 = Color3.fromRGB(255, 255, 255)
- alert_label.TextSize = 18
- local alert_effect = Instance.new("Frame", alert_label)
- alert_effect.BackgroundColor3 = Color3.fromRGB(49, 49, 49)
- alert_effect.BorderSizePixel = 0
- alert_effect.Position = UDim2.new(0, 0, 1, 0)
- alert_effect.Size = UDim2.new(1, 0, 0, 3)
- local alert_image = Instance.new("ImageLabel", alert_label)
- alert_image.BackgroundTransparency = 1
- alert_image.Position = UDim2.new(1, -23, 0.5, -8)
- alert_image.Size = UDim2.new(0, 16, 0, 16)
- if type_ then
- alert_image.Image = "http://www.roblox.com/asset/?id=4831651949"
- else
- alert_image.Image = "http://www.roblox.com/asset/?id=4831651758"
- end
- wait(wait_time)
- alert_label:Destroy()
- end
- function cheats_lib:AddSlider(title, min, max, default, callback)
- local s_container = Instance.new("Frame", new_frame)
- local s_title = Instance.new("TextLabel", s_container)
- local s_button = Instance.new("TextButton", s_container)
- local s_frame = Instance.new("Frame", s_container)
- local s_value = Instance.new("TextLabel", s_container)
- s_container.Name = string.gsub(title, " ", "").."SLD"
- s_container.BackgroundColor3 = Color3.fromRGB(53, 53, 53)
- s_container.BorderSizePixel = 0
- s_container.Size = UDim2.new(0.95, 0, 0, 40)
- s_title.Text = " "..title
- s_title.BackgroundTransparency = 1
- s_title.Position = UDim2.new(0,0,0,0)
- s_title.Size = UDim2.new(0.5, 0, 0.8, 0)
- s_title.Font = Enum.Font.SourceSansSemibold
- s_title.TextXAlignment = Enum.TextXAlignment.Left
- s_title.TextColor3 = Color3.fromRGB(255, 255, 255)
- s_title.TextSize = 18
- s_button.BackgroundColor3 = Color3.fromRGB(116, 116, 116)
- s_button.BorderSizePixel = 0
- s_button.Size = UDim2.new(1, 0, 0.2, 0)
- s_button.Position = UDim2.new(0, 0, 0.8, 0)
- s_button.ClipsDescendants = true
- s_button.Text = ""
- s_button.AutoButtonColor = false
- s_frame.BackgroundColor3 = Color3.fromRGB(177, 177, 177)
- s_frame.BorderSizePixel = 0
- s_frame.Size = UDim2.new(0.5, 0, 0.2, 0)
- s_frame.ZIndex = 2
- s_frame.Position = UDim2.new(0, 0, 0.8, 0)
- s_value.BackgroundTransparency = 1
- s_value.Position = UDim2.new(0.5, 0, 0, 0)
- s_value.Size = UDim2.new(0.5, 0, 0.8, 0)
- s_value.Font = Enum.Font.SourceSansSemibold
- s_value.TextColor3 = Color3.fromRGB(255, 255, 255)
- s_value.TextSize = 18
- s_value.Text = tostring(default)
- local mouse = game.Players.LocalPlayer:GetMouse()
- local uis = game:GetService("UserInputService")
- local value
- local move
- local kill
- s_button.MouseButton1Down:Connect(function()
- s_frame.Size = UDim2.new(0, math.clamp(mouse.X - s_frame.AbsolutePosition.X, 0, s_button.AbsoluteSize.X), 0.2, 0)
- value = math.floor((((tonumber(max) - tonumber(min)) / s_button.AbsoluteSize.X) * s_frame.AbsoluteSize.X) + tonumber(min))
- callback(value)
- s_value.Text = value
- move = mouse.Move:Connect(function()
- value = math.floor((((tonumber(max) - tonumber(min)) / s_button.AbsoluteSize.X) * s_frame.AbsoluteSize.X) + tonumber(min))
- callback(value)
- s_value.Text = value
- s_frame.Size = UDim2.new(0, math.clamp(mouse.X - s_frame.AbsolutePosition.X, 0, s_button.AbsoluteSize.X), 0.2, 0)
- end)
- kill = uis.InputEnded:Connect(function(Mouse)
- if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
- value = math.floor((((tonumber(max) - tonumber(min)) / s_button.AbsoluteSize.X) * s_frame.AbsoluteSize.X) + tonumber(min))
- callback(value)
- move:Disconnect()
- kill:Disconnect()
- end
- end)
- end)
- end
- return cheats_lib
- end
- return options_lib
- end
- return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement