Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local library = {}
- local mouse = game.Players.LocalPlayer:GetMouse()
- local ts = game:GetService("TweenService")
- function library:createWindow(title, colors)
- local csk = {}
- local step = 1 / (#colors-1)
- for i=1,#colors do
- if i == 1 then
- table.insert(csk, i, ColorSequenceKeypoint.new(0, colors[i]))
- else
- table.insert(csk, i, ColorSequenceKeypoint.new(0 + step*(i-1), colors[i]))
- end
- end
- local window = {}
- local WindowName = Instance.new("ScreenGui")
- local Window = Instance.new("Frame")
- local Title = Instance.new("TextLabel")
- local ToggleOpen = Instance.new("TextButton")
- local Underglow = Instance.new("Frame")
- local Content = Instance.new("Frame")
- WindowName.Name = title
- WindowName.Parent = game.Players.LocalPlayer.PlayerGui
- Window.Name = "Window"
- Window.Parent = WindowName
- Window.BackgroundColor3 = Color3.new(0.0784314, 0.0784314, 0.0784314)
- Window.BorderSizePixel = 0
- Window.Position = UDim2.new(0, 150, 0, 150)
- Window.Size = UDim2.new(0, 175, 0, 25)
- Title.Name = "Title"
- Title.Parent = Window
- Title.BackgroundColor3 = Color3.new(1, 1, 1)
- Title.BackgroundTransparency = 1
- Title.Position = UDim2.new(0.15, 0, 0, 0)
- Title.Size = UDim2.new(0.7, 0, 1, 0)
- Title.Font = Enum.Font.SourceSansBold
- Title.FontSize = Enum.FontSize.Size14
- Title.Text = title
- Title.TextColor3 = Color3.new(1, 1, 1)
- Title.TextScaled = true
- Title.TextSize = 14
- Title.TextWrapped = true
- local UIGradient_1 = Instance.new("UIGradient", Title)
- UIGradient_1.Color = ColorSequence.new(csk)
- ToggleOpen.Name = "ToggleOpen"
- ToggleOpen.Parent = Window
- ToggleOpen.BackgroundColor3 = Color3.new(1, 1, 1)
- ToggleOpen.BackgroundTransparency = 1
- ToggleOpen.BorderSizePixel = 0
- ToggleOpen.Position = UDim2.new(0.85, 0, 0, 0)
- ToggleOpen.Size = UDim2.new(0.15, 0, 1, 0)
- ToggleOpen.Font = Enum.Font.SourceSansBold
- ToggleOpen.FontSize = Enum.FontSize.Size14
- ToggleOpen.Text = "+"
- ToggleOpen.TextColor3 = Color3.new(1, 1, 1)
- ToggleOpen.TextScaled = true
- ToggleOpen.TextSize = 14
- ToggleOpen.TextWrapped = true
- local UIGradient_2 = Instance.new("UIGradient", ToggleOpen)
- UIGradient_2.Color = ColorSequence.new(csk)
- ToggleOpen.MouseButton1Down:connect(function()
- if Content.Size == UDim2.new(1,0,#Content:GetChildren()-1,0) then
- Content:TweenSize(UDim2.new(1,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.1, true)
- ToggleOpen.Text = "+"
- elseif Content.Size == UDim2.new(1,0,0,0) then
- Content:TweenSize(UDim2.new(1,0,#Content:GetChildren()-1,0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true)
- ToggleOpen.Text = "-"
- end
- end)
- Underglow.Name = "Underglow"
- Underglow.Parent = Window
- Underglow.BackgroundColor3 = Color3.new(1, 1, 1)
- Underglow.BorderSizePixel = 0
- Underglow.Position = UDim2.new(0, 0, 1, -2)
- Underglow.Size = UDim2.new(1, 0, 0, 2)
- local UIGradient_3 = Instance.new("UIGradient", Underglow)
- UIGradient_3.Color = ColorSequence.new(csk)
- Content.Name = "Content"
- Content.Parent = Window
- Content.BackgroundColor3 = Color3.new(1, 1, 1)
- Content.BackgroundTransparency = 1
- Content.BorderSizePixel = 0
- Content.Position = UDim2.new(0, 0, 1, 0)
- Content.Size = UDim2.new(1, 0, 0, 0)
- Content.ClipsDescendants = true
- local UIListLayout = Instance.new("UIListLayout", Content)
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- local mouseondrag = false
- Window.MouseEnter:connect(function()
- mouseondrag = true
- end)
- Window.MouseLeave:connect(function()
- mouseondrag = false
- end)
- local mousedown = false
- mouse.Button1Down:connect(function()
- if mouseondrag == true then
- mousedown = true
- end
- end)
- mouse.Button1Up:connect(function()
- mousedown = false
- end)
- spawn(function()
- while true do
- wait()
- if mousedown == true then
- Window:TweenPosition(UDim2.new(0, mouse.X, 0, mouse.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.1, true)
- end
- end
- end)
- function window:createToggle(text, func, waittime)
- local TogglePanelBackground = Instance.new("Frame")
- local ToggleBackground = Instance.new("Frame")
- local ToggleSlider = Instance.new("Frame")
- local ToggleText = Instance.new("TextLabel")
- TogglePanelBackground.Name = "TogglePanelBackground"
- TogglePanelBackground.Parent = Content
- TogglePanelBackground.BackgroundColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
- TogglePanelBackground.BorderSizePixel = 0
- TogglePanelBackground.Size = UDim2.new(1, 0, 0, 25)
- ToggleBackground.Name = "ToggleBackground"
- ToggleBackground.Parent = TogglePanelBackground
- ToggleBackground.BackgroundColor3 = Color3.new(1, 0, 0)
- ToggleBackground.BorderSizePixel = 0
- ToggleBackground.Position = UDim2.new(0.649999976, 0, 0.100000001, 0)
- ToggleBackground.Size = UDim2.new(0.300000012, 0, 0.800000012, 0)
- ToggleSlider.Name = "ToggleSlider"
- ToggleSlider.Parent = ToggleBackground
- ToggleSlider.BackgroundColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
- ToggleSlider.BorderColor3 = Color3.new(1, 1, 1)
- ToggleSlider.BorderSizePixel = 2
- ToggleSlider.Position = UDim2.new(0.0, 0, 0, 0)
- ToggleSlider.Size = UDim2.new(0.400000006, 0, 1, 0)
- ToggleSlider.BorderMode = Enum.BorderMode.Inset
- local UIGradient_1 = Instance.new("UIGradient", ToggleSlider)
- UIGradient_1.Color = ColorSequence.new(csk)
- ToggleText.Name = "ToggleText"
- ToggleText.Parent = TogglePanelBackground
- ToggleText.BackgroundColor3 = Color3.new(1, 1, 1)
- ToggleText.BackgroundTransparency = 1
- ToggleText.Position = UDim2.new(0.0500000007, 0, 0, 0)
- ToggleText.Size = UDim2.new(0.5, 0, 1, 0)
- ToggleText.Font = Enum.Font.SourceSansBold
- ToggleText.FontSize = Enum.FontSize.Size18
- ToggleText.Text = "Toggle"
- ToggleText.TextColor3 = Color3.new(1, 1, 1)
- ToggleText.TextSize = 16
- ToggleText.TextWrapped = true
- local UIGradient_2 = Instance.new("UIGradient", ToggleText)
- UIGradient_2.Color = ColorSequence.new(csk)
- local enteredSlider = false
- ToggleBackground.MouseEnter:connect(function()
- enteredSlider = true
- end)
- ToggleBackground.MouseLeave:connect(function()
- enteredSlider = false
- end)
- local toggle = false
- mouse.Button1Up:connect(function()
- if enteredSlider == true then
- if ToggleSlider.Position == UDim2.new(0.6,0,0,0) then
- ToggleSlider:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true)
- ToggleBackground.BackgroundColor3 = Color3.fromRGB(255,0,0)
- toggle = false
- elseif ToggleSlider.Position == UDim2.new(0,0,0,0) then
- ToggleSlider:TweenPosition(UDim2.new(0.6,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true)
- ToggleBackground.BackgroundColor3 = Color3.fromRGB(0,255,0)
- toggle = true
- end
- end
- end)
- spawn(function()
- while wait(waittime) do
- if toggle then
- func()
- end
- end
- end)
- end
- function window:createButton(text, buttontext, func)
- local ButtonPanelBackground = Instance.new("Frame")
- local Button = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local ButtonLabel = Instance.new("TextLabel")
- ButtonPanelBackground.Name = "ButtonPanelBackground"
- ButtonPanelBackground.Parent = Content
- ButtonPanelBackground.BackgroundColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
- ButtonPanelBackground.BorderSizePixel = 0
- ButtonPanelBackground.Position = UDim2.new(0, 0, 0, 25)
- ButtonPanelBackground.Size = UDim2.new(1, 0, 0, 25)
- Button.Name = "Button"
- Button.Parent = ButtonPanelBackground
- Button.BackgroundColor3 = Color3.new(0, 0, 0)
- Button.BorderColor3 = Color3.new(1, 1, 1)
- Button.BorderSizePixel = 2
- Button.Position = UDim2.new(0.649999976, 0, 0.100000001, 0)
- Button.Size = UDim2.new(0.300000012, 0, 0.800000012, 0)
- local UIGradient_1 = Instance.new("UIGradient", Button)
- UIGradient_1.Color = ColorSequence.new(csk)
- TextLabel.Parent = Button
- TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel.BackgroundTransparency = 1
- TextLabel.Position = UDim2.new(0, 0, 0, 1)
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Font = Enum.Font.SourceSansBold
- TextLabel.FontSize = Enum.FontSize.Size14
- TextLabel.Text = "GO"
- TextLabel.TextColor3 = Color3.new(1, 1, 1)
- TextLabel.TextScaled = true
- TextLabel.TextSize = 14
- TextLabel.TextWrapped = true
- TextLabel.TextYAlignment = Enum.TextYAlignment.Bottom
- ButtonLabel.Name = "ButtonLabel"
- ButtonLabel.Parent = ButtonPanelBackground
- ButtonLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- ButtonLabel.BackgroundTransparency = 1
- ButtonLabel.Position = UDim2.new(0.0500000007, 0, 0, 0)
- ButtonLabel.Size = UDim2.new(0.5, 0, 1, 0)
- ButtonLabel.Font = Enum.Font.SourceSansBold
- ButtonLabel.FontSize = Enum.FontSize.Size18
- ButtonLabel.Text = "TP to player"
- ButtonLabel.TextColor3 = Color3.new(1, 1, 1)
- ButtonLabel.TextSize = 16
- ButtonLabel.TextWrapped = true
- local UIGradient_2 = Instance.new("UIGradient", ButtonLabel)
- UIGradient_2.Color = ColorSequence.new(csk)
- local onButton = false
- Button.MouseEnter:connect(function()
- onButton = true
- end)
- Button.MouseLeave:connect(function()
- onButton = false
- end)
- local toggle = false
- mouse.Button1Up:connect(function()
- if onButton == true then
- func()
- spawn(function()
- Button.BorderSizePixel = 1.5
- wait(0.05)
- Button.BorderSizePixel = 2
- end)
- end
- end)
- end
- return window
- end
- return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement