Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function randomName()
- local data = ""
- for i=0,20,1 do
- data = data .. tostring(string.char(math.ceil(math.random() * 254)))
- end
- return data
- end
- local uilib = Instance.new("ScreenGui")
- uilib.Name = randomName()
- uilib.Parent = game:GetService("CoreGui")
- uilib.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- local library = {}
- local TweenService = game:GetService("TweenService")
- local uis = game:GetService("UserInputService")
- local tabcount = 0
- local rainbow = 0
- _G.breatherate = 0.005
- local color
- local rainbows = {}
- local buttoncount = {}
- function library:CreateTab(name, rainbow123, color123)
- tabcount = tabcount+1
- buttoncount[tabcount] = 0
- local topbar = Instance.new("Frame")
- local container = Instance.new("Frame")
- local UIListLayout = Instance.new("UIListLayout")
- local bar1 = Instance.new("Frame")
- local title = Instance.new("TextLabel")
- topbar.Name = "topbar"
- topbar.Parent = uilib
- topbar.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- topbar.BorderSizePixel = 0
- topbar.Position = UDim2.new(0, (tabcount)*13+(tabcount-1)*200, 0.0128041022, 0)
- topbar.Size = UDim2.new(0, 200, 0, 30)
- topbar.Active = true
- topbar.Selectable = true
- topbar.Draggable = true
- container.Name = "container"
- container.Parent = topbar
- container.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- container.BackgroundTransparency = 1.000
- container.BorderSizePixel = 0
- container.Position = UDim2.new(0, 2, 1, 0)
- container.Size = UDim2.new(1, -4, 0, 300)
- UIListLayout.Parent = container
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- bar1.Name = "bar1"
- bar1.Parent = topbar
- bar1.BorderSizePixel = 0
- bar1.Position = UDim2.new(0, 0, 1, -3)
- bar1.Size = UDim2.new(1, 0, 0, 3)
- title.Name = "title"
- title.Parent = topbar
- title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- title.BackgroundTransparency = 1.000
- title.BorderSizePixel = 0
- title.Position = UDim2.new(0, 13, 0, 0)
- title.Size = UDim2.new(1.04999995, -40, 1, 0)
- title.Font = Enum.Font.SourceSans
- title.Text = name
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.TextSize = 16.000
- title.TextXAlignment = Enum.TextXAlignment.Left
- game:GetService("RunService").RenderStepped:Connect(function()
- if rainbow123 == true then
- local r = (math.sin(workspace.DistributedGameTime/2)/2)+0.5
- local g = (math.sin(workspace.DistributedGameTime)/2)+0.5
- local b = (math.sin(workspace.DistributedGameTime*1.5)/2)+0.5
- local color = Color3.new(r, g, b)
- bar1.BackgroundColor3 = color
- elseif rainbow123 == false then
- bar1.BackgroundColor3 = color123
- end
- end)
- local GamerLibrary = {}
- function GamerLibrary:CreateLabel(name)
- local label = Instance.new("TextLabel")
- label.Name = "label"
- label.Parent = container
- label.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- label.BorderSizePixel = 0
- label.Position = UDim2.new(0.413265318, 0, 0.0166666675, 0)
- label.Size = UDim2.new(1, 0, 0, 25)
- label.Font = Enum.Font.SourceSans
- label.TextColor3 = Color3.fromRGB(255, 255, 255)
- label.TextSize = 16.000
- label.Text = name
- end
- function GamerLibrary:CreateButton(name,func)
- local button = Instance.new("TextButton")
- button.Name = "button"
- button.Parent = container
- button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- button.BorderColor3 = Color3.fromRGB(0, 0, 0)
- button.BorderSizePixel = 0
- button.Position = UDim2.new(0, 0, 0.446533352, 0)
- button.Size = UDim2.new(1, 0, 0, 25)
- button.Font = Enum.Font.SourceSans
- button.TextColor3 = Color3.fromRGB(255, 255, 255)
- button.TextSize = 16.000
- button.Text = name
- button.MouseButton1Click:Connect(func);
- end
- function GamerLibrary:CreateDivider(name)
- local divider = Instance.new("TextLabel")
- divider.Name = "divider"
- divider.Parent = container
- divider.BackgroundColor3 = Color3.fromRGB(21, 21, 21)
- divider.BorderColor3 = Color3.fromRGB(255, 255, 255)
- divider.BorderSizePixel = 0
- divider.Position = UDim2.new(0, 0, 0.356666654, 0)
- divider.Size = UDim2.new(1, 0, -0.0201333109, 25)
- divider.Font = Enum.Font.SourceSans
- divider.Text = name
- divider.TextColor3 = Color3.fromRGB(255, 255, 255)
- divider.TextSize = 16.000
- end
- function GamerLibrary:CreateToggle(name,callback)
- local toggletext = Instance.new("TextLabel")
- local togglebutton = Instance.new("TextButton")
- toggletext.Name = "toggletext"
- toggletext.Parent = container
- toggletext.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- toggletext.BorderSizePixel = 0
- toggletext.Size = UDim2.new(1, 0, 0, 25)
- toggletext.Font = Enum.Font.SourceSans
- toggletext.Text = " " .. name
- toggletext.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggletext.TextSize = 16.000
- toggletext.TextXAlignment = Enum.TextXAlignment.Left
- togglebutton.Name = "togglebutton"
- togglebutton.Parent = toggletext
- togglebutton.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
- togglebutton.BorderColor3 = Color3.fromRGB(71, 71, 71)
- togglebutton.Position = UDim2.new(0.820691466, 0, 0.100000001, 0)
- togglebutton.Size = UDim2.new(0.102777764, 0, -0.219999999, 22)
- togglebutton.Font = Enum.Font.SourceSans
- togglebutton.Text = "X"
- togglebutton.TextColor3 = Color3.fromRGB(255, 255, 255)
- togglebutton.TextSize = 16.000
- togglebutton.MouseButton1Click:Connect(function()
- if togglebutton.Text == "X" then
- callback(true)
- togglebutton.Text = "✓"
- elseif togglebutton.Text == "✓" then
- togglebutton.Text = "X"
- callback(false)
- end
- end)
- end
- function GamerLibrary:CreateSlider(name,min,max,func)
- local slidertext = Instance.new("TextLabel")
- local slidervalue = Instance.new("TextLabel")
- local Slider = Instance.new("Frame")
- local Bar = Instance.new("Frame")
- local Knob = Instance.new("TextButton")
- slidertext.Name = "slidertext"
- slidertext.Parent = container
- slidertext.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- slidertext.BorderSizePixel = 0
- slidertext.Position = UDim2.new(0, 0, 0.503199995, 0)
- slidertext.Size = UDim2.new(1, 0, 0, 25)
- slidertext.Font = Enum.Font.SourceSans
- slidertext.Text = " " .. name
- slidertext.TextColor3 = Color3.fromRGB(255, 255, 255)
- slidertext.TextSize = 16.000
- slidertext.TextXAlignment = Enum.TextXAlignment.Left
- slidervalue.Name = "slidervalue"
- slidervalue.Parent = slidertext
- slidervalue.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- slidervalue.BackgroundTransparency = 1.000
- slidervalue.Position = UDim2.new(0.12513417, 0, -0.0362510309, 0)
- slidervalue.Size = UDim2.new(0.349056602, 0, 0, 25)
- slidervalue.Font = Enum.Font.SourceSans
- slidervalue.Text = "0"
- slidervalue.TextColor3 = Color3.fromRGB(255, 255, 255)
- slidervalue.TextSize = 16.000
- slidervalue.TextXAlignment = Enum.TextXAlignment.Right
- Slider.Name = "Slider"
- Slider.Parent = slidertext
- Slider.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
- Slider.BackgroundTransparency = 1.000
- Slider.BorderSizePixel = 0
- Slider.Size = UDim2.new(0, 281, 0, 13)
- Bar.Name = "Bar"
- Bar.Parent = Slider
- Bar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Bar.Position = UDim2.new(0.370106757, 0, 0.846153855, 0)
- Bar.Size = UDim2.new(0, 85, 0, 3)
- Knob.Name = "Knob"
- Knob.Parent = Bar
- Knob.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- Knob.Position = UDim2.new(-0.00357127469, 0, -2.66666675, 0)
- Knob.Size = UDim2.new(0, 6, 0, 18)
- Knob.Font = Enum.Font.SourceSans
- Knob.Text = ""
- Knob.TextColor3 = Color3.fromRGB(0, 0, 0)
- Knob.TextSize = 14.000
- local bar = Bar;
- local knob = Knob;
- local valueChangedEvent = Instance.new("BindableEvent")
- local startXScale = -.05;
- local endXScale = .95;
- local MinValue = min
- local MaxValue = max
- local Valueasd;
- local mouse = game:GetService("Players").LocalPlayer:GetMouse()
- valueChangedEvent.Name = "ValueChanged"
- valueChangedEvent.Archivable = true
- -- Updates the position of the knob as well as the value
- local prevValue = nil;
- local function Update()
- local absPosition = Bar.AbsolutePosition.X;
- local absSize = Bar.AbsoluteSize.X;
- local mouseDelta = math.min(math.max(0, mouse.X - absPosition), absSize);
- local value = MinValue + ((mouseDelta / absSize) * (MaxValue - MinValue));
- Valueasd = math.floor(value)
- slidervalue.Text = math.floor(value)
- knob.Position = UDim2.new((mouseDelta / absSize) - .05, knob.Position.X.Offset, knob.Position.Y.Scale, knob.Position.Y.Offset);
- if (prevValue ~= nil and math.floor(prevValue) ~= math.floor(value)) then
- valueChangedEvent:Fire(prevValue, math.floor(value));
- prevValue = math.floor(value);
- else
- prevValue = math.floor(value);
- end
- end
- -- Coroutine to keep updating
- local keepUpdating = false;
- local function Updater()
- while (true) do
- if (keepUpdating) then
- Update()
- func(Valueasd)
- end
- wait(.05)
- end
- end
- local taskCoro = coroutine.create(Updater)
- coroutine.resume(taskCoro);
- -- Event Connecting
- knob.MouseButton1Down:Connect(function()
- keepUpdating = true;
- end)
- local UserInputService = game:GetService("UserInputService")
- UserInputService.InputEnded:Connect(function(inputObject)
- if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then
- keepUpdating = false;
- end
- end)
- end
- function GamerLibrary:CreateTextbox(name,placeholder,func)
- local textboxtext = Instance.new("TextLabel")
- local textbox = Instance.new("TextBox")
- textboxtext.Name = "textboxtext"
- textboxtext.Parent = container
- textboxtext.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- textboxtext.BorderColor3 = Color3.fromRGB(54, 54, 54)
- textboxtext.BorderSizePixel = 0
- textboxtext.Position = UDim2.new(0.0102040814, 0, 0.0733333379, 0)
- textboxtext.Size = UDim2.new(1, 0, 0.0599999987, 25)
- textboxtext.Font = Enum.Font.SourceSans
- textboxtext.Text = name
- textboxtext.TextColor3 = Color3.fromRGB(255, 255, 255)
- textboxtext.TextSize = 16.000
- textboxtext.TextYAlignment = Enum.TextYAlignment.Top
- textbox.Name = "textbox"
- textbox.Parent = textboxtext
- textbox.BackgroundColor3 = Color3.fromRGB(66, 66, 66)
- textbox.BorderColor3 = Color3.fromRGB(67, 67, 67)
- textbox.BorderSizePixel = 2
- textbox.Position = UDim2.new(0.214285716, 0, 0.438935041, 0)
- textbox.Size = UDim2.new(0, 112, 0, 18)
- textbox.Font = Enum.Font.SourceSans
- textbox.PlaceholderText = placeholder
- textbox.Text = ""
- textbox.TextColor3 = Color3.fromRGB(255, 255, 255)
- textbox.TextSize = 16.000
- textbox.TextWrapped = true
- textbox.FocusLost:Connect(function()
- func(textbox.Text)
- end)
- end
- return GamerLibrary;
- end
- return library;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement