Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Mouse = game.Players.LocalPlayer:GetMouse()
- local Library = {}
- function Library:CreateWindow(title)
- local BodyYSize = 0
- local InputService = game:GetService("UserInputService")
- local CoolUIlib = Instance.new("ScreenGui")
- local TopMain = Instance.new("ImageLabel")
- local BodyMain = Instance.new("Frame")
- local Container = Instance.new("Frame")
- local UIListLayout = Instance.new("UIListLayout")
- local TitleText = Instance.new("TextLabel")
- local function Resize(Value)
- BodyYSize = BodyYSize + Value
- Container.Size = UDim2.new(0, 155, 0, BodyYSize)
- BodyMain.Size = UDim2.new(0, 155, 0, BodyYSize)
- end
- CoolUIlib.Name = "CoolUIlib"
- CoolUIlib.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- CoolUIlib.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- TopMain.Name = "TopMain"
- TopMain.Parent = CoolUIlib
- TopMain.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TopMain.BackgroundTransparency = 1.000
- TopMain.BorderSizePixel = 0
- TopMain.Position = UDim2.new(0.0431854166, 0, 0.16103521, 0)
- TopMain.Size = UDim2.new(0, 155, 0, 40)
- TopMain.Image = "http://www.roblox.com/asset/?id=5247156107"
- -- Drag Function
- local function dragify(Frame)
- -- Locals
- local dragSpeed = .25 -- You can edit this. (Smoothness)
- -- No need to edit
- local dragToggle = nil
- local dragInput = nil
- local dragStart = nil
- -- Update Frame Position
- function updateInput(input)
- local Delta = input.Position - dragStart
- local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
- game:GetService("TweenService"):Create(Frame, TweenInfo.new(.25), {Position = Position}):Play()
- end
- -- User is is inputting
- Frame.InputBegan:Connect(function(input)
- if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
- dragToggle = true
- dragStart = input.Position
- startPos = Frame.Position
- input.Changed:Connect(function()
- if (input.UserInputState == Enum.UserInputState.End) then
- dragToggle = false
- end
- end)
- end
- end)
- -- Frame Input Changed so get the input
- Frame.InputChanged:Connect(function(input)
- if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- dragInput = input
- end
- end)
- -- User is dragging the frame
- game:GetService("UserInputService").InputChanged:Connect(function(input)
- if (input == dragInput and dragToggle) then
- updateInput(input)
- end
- end)
- end
- -- Call Drag Function
- dragify(TopMain) -- Enable dragging
- BodyMain.Name = "BodyMain"
- BodyMain.Parent = TopMain
- BodyMain.BackgroundColor3 = Color3.fromRGB(38, 38, 38)
- BodyMain.BorderSizePixel = 0
- BodyMain.Position = UDim2.new(-0, 0, 0.845938504, 0)
- BodyMain.Size = UDim2.new(0, 155, 0, 0)
- Container.Name = "Container"
- Container.Parent = TopMain
- Container.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Container.BackgroundTransparency = 1.000
- Container.Position = UDim2.new(0, 0, 1, 0)
- Container.Size = UDim2.new(0, 155, 0, 0)
- Container.ClipsDescendants = true
- UIListLayout.Parent = Container
- UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- UIListLayout.Padding = UDim.new(0, 6)
- TitleText.Name = "TitleText"
- TitleText.Parent = TopMain
- TitleText.Active = true
- TitleText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TitleText.BackgroundTransparency = 1.000
- TitleText.Size = UDim2.new(0, 155, 0, 36)
- TitleText.Font = Enum.Font.GothamBold
- TitleText.Text = title
- TitleText.TextColor3 = Color3.fromRGB(191, 191, 191)
- TitleText.TextSize = 18.000
- local a = {}
- --[[
- function a:CreateButton(text)
- --thing
- end
- ]]
- function a:CreateButton(text, callback)
- local callback = callback or function() end
- Resize(49)
- local ButtonBox = Instance.new("ImageLabel")
- local ButtonRectangle = Instance.new("ImageLabel")
- local ButtonText = Instance.new("TextButton")
- ButtonBox.Name = "ButtonBox"
- ButtonBox.Parent = Container
- ButtonBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ButtonBox.BackgroundTransparency = 1.000
- ButtonBox.BorderSizePixel = 0
- ButtonBox.Position = UDim2.new(0, 0, 2.62814832, 0)
- ButtonBox.Size = UDim2.new(0, 155, 0, 43)
- ButtonBox.Image = "http://www.roblox.com/asset/?id=5247155672"
- ButtonRectangle.Name = "ButtonRectangle"
- ButtonRectangle.Parent = ButtonBox
- ButtonRectangle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ButtonRectangle.BackgroundTransparency = 1.000
- ButtonRectangle.BorderSizePixel = 0
- ButtonRectangle.Position = UDim2.new(0.136441737, 0, 0.0930232555, 0)
- ButtonRectangle.Size = UDim2.new(0, 112, 0, 35)
- ButtonRectangle.Image = "http://www.roblox.com/asset/?id=5247155729"
- ButtonText.Name = "ButtonText"
- ButtonText.Parent = ButtonBox
- ButtonText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ButtonText.BackgroundTransparency = 1.000
- ButtonText.Position = UDim2.new(0.136441723, 0, 0.0929998383, 0)
- ButtonText.Size = UDim2.new(0, 111, 0, 35)
- ButtonText.Font = Enum.Font.GothamSemibold
- ButtonText.Text = text
- ButtonText.TextColor3 = Color3.fromRGB(191, 191, 191)
- ButtonText.TextSize = 14.000
- ButtonText.MouseButton1Click:Connect(function()
- --[[ButtonText.ImageTransparency = 0.3
- wait()
- ButtonText.ImageTransparency = 0]]
- local c = Instance.new("ImageLabel", ButtonText)
- c.BackgroundTransparency = 1
- c.Image = "rbxassetid://3570695787"
- c.ImageTransparency = 0.6
- c.Position = UDim2.new(0, (Mouse.X - c.AbsolutePosition.X), 0, (Mouse.Y - c.AbsolutePosition.Y))
- c.ScaleType = "Slice"
- c.SliceCenter = Rect.new(100, 100, 100, 100)
- c.SliceScale = 1
- local Size = 0
- if ButtonText.AbsoluteSize.X > ButtonText.AbsoluteSize.Y then
- Size = ButtonText.AbsoluteSize.X*1.5
- elseif ButtonText.AbsoluteSize.X < ButtonText.AbsoluteSize.Y then
- Size = ButtonText.AbsoluteSize.Y*1.5
- elseif ButtonText.AbsoluteSize.X == ButtonText.AbsoluteSize.Y then
- Size = ButtonText.AbsoluteSize.X*1.5
- end
- c:TweenSizeAndPosition(UDim2.new(0, Size, 0, Size), UDim2.new(.5, -Size/2, .5, -Size/2), "Out", "Linear", .5)
- ButtonText.MouseButton1Up:Connect(function()
- while c.ImageTransparency ~= 1 do
- wait()
- c.ImageTransparency = c.ImageTransparency + 0.02
- if c.ImageTransparency == 1 then c:Destroy() end
- end
- end)
- end)
- ButtonText.MouseButton1Click:Connect(function()
- pcall(callback)
- end)
- end
- function a:CreateToggle(callback)
- local callback = callback or function() end
- Resize(49)
- local CheckBox = Instance.new("ImageLabel")
- local CheckRectangle = Instance.new("ImageLabel")
- local CheckPart = Instance.new("ImageLabel")
- local ToggleButton = Instance.new("TextButton")
- CheckBox.Name = "CheckBox"
- CheckBox.Parent = Container
- CheckBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- CheckBox.BackgroundTransparency = 1.000
- CheckBox.BorderSizePixel = 0
- CheckBox.Position = UDim2.new(0, 0, 4.1961112, 0)
- CheckBox.Size = UDim2.new(0, 155, 0, 43)
- CheckBox.Image = "http://www.roblox.com/asset/?id=5247155794"
- CheckRectangle.Name = "CheckRectangle"
- CheckRectangle.Parent = CheckBox
- CheckRectangle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- CheckRectangle.BackgroundTransparency = 1.000
- CheckRectangle.BorderSizePixel = 0
- CheckRectangle.Position = UDim2.new(0.283819318, 0, 0.0929998383, 0)
- CheckRectangle.Size = UDim2.new(0, 66, 0, 34)
- CheckRectangle.Image = "http://www.roblox.com/asset/?id=5247155881"
- CheckPart.Name = "CheckPart"
- CheckPart.Parent = CheckRectangle
- CheckPart.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- CheckPart.BackgroundTransparency = 1.000
- CheckPart.Size = UDim2.new(0, 34, 0, 34)
- CheckPart.Image = "http://www.roblox.com/asset/?id=5247155834"
- ToggleButton.Name = "ToggleButton"
- ToggleButton.Parent = CheckRectangle
- ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ToggleButton.BackgroundTransparency = 1.000
- ToggleButton.Size = UDim2.new(0, 66, 0, 34)
- ToggleButton.AutoButtonColor = false
- ToggleButton.Font = Enum.Font.SourceSans
- ToggleButton.Text = ""
- ToggleButton.TextColor3 = Color3.fromRGB(0, 0, 0)
- ToggleButton.TextSize = 14.000
- local TweenService = game:GetService("TweenService")
- local TweenSettings_Toggle = TweenInfo.new(0.3,Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0)
- local OnPos = UDim2.new(0.485, 0, 0, 0)
- local OffPos = UDim2.new(0, 0, 0, 0)
- local Button_TweenIn = TweenService:Create(CheckPart, TweenSettings_Toggle, {Position = OnPos,})
- local Button_TweenOut = TweenService:Create(CheckPart, TweenSettings_Toggle, {Position = OffPos,})
- local Toggled = false
- ToggleButton.MouseButton1Click:Connect(function()
- if Toggled then
- Toggled = false
- Button_TweenIn:Pause()
- Button_TweenOut:Play()
- wait(0.2)
- CheckRectangle.ImageColor3 = Color3.fromRGB(255, 255, 255)
- else
- Toggled = true
- Button_TweenOut:Pause()
- Button_TweenIn:Play()
- wait(0.2)
- CheckRectangle.ImageColor3 = Color3.fromRGB(106, 255, 168)
- pcall(callback, Toggled)
- end
- end)
- end
- function a:CreateLabel(text)
- Resize(42)
- local text = text or ""
- local LabelBox = Instance.new("ImageLabel")
- local LabelText = Instance.new("TextButton")
- LabelBox.Name = "LabelBox"
- LabelBox.Parent = Container
- LabelBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- LabelBox.BackgroundTransparency = 1.000
- LabelBox.BorderSizePixel = 0
- LabelBox.Position = UDim2.new(-0.00217737956, 0, 1.35555577, 0)
- LabelBox.Size = UDim2.new(0, 155, 0, 36)
- LabelBox.Image = "http://www.roblox.com/asset/?id=5247156056"
- LabelText.Name = "LabelText"
- LabelText.Parent = LabelBox
- LabelText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- LabelText.BackgroundTransparency = 1.000
- LabelText.Size = UDim2.new(0, 155, 0, 36)
- LabelText.Font = Enum.Font.GothamSemibold
- LabelText.Text = text
- LabelText.TextColor3 = Color3.fromRGB(191, 191, 191)
- LabelText.TextSize = 14.000
- LabelText.TextWrapped = true
- end
- function a:CreateInput(placeholder, callback)
- Resize(49)
- local placeholder = placeholder or "Input"
- local callback = callback or function() end
- local InputBox = Instance.new("ImageLabel")
- local ButtonRectangle_2 = Instance.new("ImageLabel")
- local InputText = Instance.new("TextBox")
- InputBox.Name = "InputBox"
- InputBox.Parent = Container
- InputBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- InputBox.BackgroundTransparency = 1.000
- InputBox.BorderSizePixel = 0
- InputBox.Position = UDim2.new(0, 0, 5.62481499, 0)
- InputBox.Size = UDim2.new(0, 155, 0, 43)
- InputBox.Image = "http://www.roblox.com/asset/?id=5247155932"
- InputText.Name = "InputText"
- InputText.Parent = InputBox
- InputText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- InputText.BackgroundTransparency = 1.000
- InputText.Position = UDim2.new(0.136000007, 0, 0.0930000022, 0)
- InputText.Size = UDim2.new(0, 112, 0, 35)
- InputText.ZIndex = 2
- InputText.Font = Enum.Font.SourceSans
- InputText.PlaceholderColor3 = Color3.fromRGB(107, 107, 107)
- InputText.PlaceholderText = placeholder
- InputText.Text = ""
- InputText.TextColor3 = Color3.fromRGB(0, 0, 0)
- InputText.TextSize = 14.000
- ButtonRectangle_2.Name = "ButtonRectangle"
- ButtonRectangle_2.Parent = InputBox
- ButtonRectangle_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- ButtonRectangle_2.BackgroundTransparency = 1.000
- ButtonRectangle_2.BorderSizePixel = 0
- ButtonRectangle_2.Position = UDim2.new(0.136441737, 0, 0.0930232555, 0)
- ButtonRectangle_2.Size = UDim2.new(0, 112, 0, 35)
- ButtonRectangle_2.Image = "http://www.roblox.com/asset/?id=5247155729"
- local inputvalue = Instance.new("StringValue")
- inputvalue.Name = "inputvalue"
- inputvalue.Parent = InputText
- inputvalue.Value = ""
- local typing = false
- InputText.Focused:Connect(function()
- typing = true
- ButtonRectangle_2.ImageColor3 = Color3.fromRGB(194, 194, 194)
- end)
- InputText.FocusLost:Connect(function()
- typing = false
- ButtonRectangle_2.ImageColor3 = Color3.fromRGB(255, 255, 255)
- inputvalue.Value = InputText.Text
- pcall(callback(inputvalue.Value))
- end)
- end
- return a;
- end
- return Library;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement