Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local hs = game:GetService("HttpService")
- local ts = game:GetService("TweenService")
- local lib = {tabs = {}, content = {}}
- local libholder = Instance.new("ScreenGui", game.CoreGui)
- libholder.Name = "LibHolder"
- function lib:CreateTab(json)
- local tabContent = {contents = 0}
- local id = hs:JSONDecode(json).id
- local text = hs:JSONDecode(json).text
- local colorRGB = hs:JSONDecode(json).colorRGB
- table.insert(lib.tabs, id, tabContent)
- local Tab = Instance.new("Frame")
- local TabLabel = Instance.new("TextLabel")
- local TabLabelShadow = Instance.new("TextLabel")
- local ShowButton = Instance.new("TextButton")
- local ShowButtonShadow = Instance.new("TextLabel")
- Tab.Name = "Tab"
- Tab.Parent = libholder
- Tab.BackgroundColor3 = Color3.fromRGB(colorRGB.r, colorRGB.g, colorRGB.b)
- Tab.BackgroundTransparency = 0.4
- Tab.BorderSizePixel = 0
- Tab.Position = UDim2.new(0, 30 + (230*#lib.tabs), 0, 30)
- Tab.Size = UDim2.new(0, 200, 0, 30)
- TabLabel.Name = "TabLabel"
- TabLabel.Parent = Tab
- TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabel.BackgroundTransparency = 1
- TabLabel.BorderSizePixel = 0
- TabLabel.Size = UDim2.new(1, 0, 1, 0)
- TabLabel.ZIndex = 3
- TabLabel.Font = Enum.Font.SourceSans
- TabLabel.FontSize = Enum.FontSize.Size24
- TabLabel.TextColor3 = Color3.new(1, 1, 1)
- TabLabel.TextSize = 20
- TabLabel.TextWrapped = true
- TabLabel.Text = text
- TabLabelShadow.Name = "TabLabelShadow"
- TabLabelShadow.Parent = Tab
- TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabelShadow.BackgroundTransparency = 1
- TabLabelShadow.BorderSizePixel = 0
- TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
- TabLabelShadow.Size = UDim2.new(1, 0, 1, 0)
- TabLabelShadow.Font = Enum.Font.SourceSans
- TabLabelShadow.FontSize = Enum.FontSize.Size24
- TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
- TabLabelShadow.TextSize = 20
- TabLabelShadow.TextWrapped = true
- TabLabelShadow.Text = text
- ShowButton.Name = "ShowButton"
- ShowButton.Parent = Tab
- ShowButton.BackgroundColor3 = Color3.new(1, 1, 1)
- ShowButton.BackgroundTransparency = 1
- ShowButton.BorderSizePixel = 0
- ShowButton.Position = UDim2.new(0.8, 0, 0, 0)
- ShowButton.Size = UDim2.new(0.2, 0, 1, 0)
- ShowButton.ZIndex = 2
- ShowButton.Font = Enum.Font.SourceSans
- ShowButton.FontSize = Enum.FontSize.Size24
- ShowButton.Text = "V"
- ShowButton.TextColor3 = Color3.new(1, 1, 1)
- ShowButton.TextSize = 20
- ShowButtonShadow.Name = "ShowButtonShadow"
- ShowButtonShadow.Parent = Tab
- ShowButtonShadow.BackgroundColor3 = Color3.new(1, 1, 1)
- ShowButtonShadow.BackgroundTransparency = 1
- ShowButtonShadow.BorderSizePixel = 0
- ShowButtonShadow.Position = UDim2.new(0.8, 1, 0, 1)
- ShowButtonShadow.Size = UDim2.new(0.2, 0, 1, 0)
- ShowButtonShadow.Font = Enum.Font.SourceSans
- ShowButtonShadow.FontSize = Enum.FontSize.Size24
- ShowButtonShadow.Text = "V"
- ShowButtonShadow.TextColor3 = Color3.new(0, 0, 0)
- ShowButtonShadow.TextSize = 20
- ShowButtonShadow.TextWrapped = true
- local content = Instance.new("Folder", Tab)
- content.Name = "Content"
- local deb = false
- ShowButton.MouseButton1Down:connect(function()
- if deb == false then
- deb = true
- for i=1,10 do
- ShowButton.TextTransparency = i/10
- ShowButtonShadow.TextTransparency = i/10
- wait()
- end
- if ShowButton.Rotation == 180 then
- ShowButton.Rotation = 0
- ShowButtonShadow.Rotation = 0
- else
- ShowButton.Rotation = 180
- ShowButtonShadow.Rotation = 180
- end
- for i=0,#content:GetChildren() do
- if content:GetChildren()[#content:GetChildren()-i] ~= nil then
- if content:GetChildren()[#content:GetChildren()-i].Size == UDim2.new(1,0,1,0) then
- content:GetChildren()[#content:GetChildren()-i]:TweenSize(UDim2.new(0,0,1,0),nil,nil,1)
- wait(0.2)
- else
- if content:GetChildren()[i+1] ~= nil then
- content:GetChildren()[i+1]:TweenSize(UDim2.new(1,0,1,0),nil,nil,1)
- wait(0.2)
- end
- end
- end
- end
- for i=-10,-1 do
- ShowButton.TextTransparency = (i/10)*-1
- ShowButtonShadow.TextTransparency = (i/10)*-1
- wait()
- end
- wait(0.2)
- deb = false
- end
- end)
- local mouseon = false
- Tab.MouseEnter:connect(function()
- mouseon = true
- end)
- Tab.MouseLeave:connect(function()
- mouseon = false
- end)
- local mouse = game.Players.LocalPlayer:GetMouse()
- local mousedown = false
- mouse.Button1Down:connect(function()
- if mouseon == true then
- mousedown = true
- end
- end)
- mouse.Button1Up:connect(function()
- mousedown = false
- end)
- spawn(function()
- while true do
- if mousedown == true then
- local mousepos = Vector2.new(mouse.X, mouse.Y)
- local size = Tab.AbsoluteSize / 2
- local goal = UDim2.new(0, mousepos.X-size.X, 0, mousepos.Y-size.Y)
- Tab:TweenPosition(goal,nil,Enum.EasingStyle.Quad,nil,0.05)
- end
- wait(.1)
- end
- end)
- function tabContent:CreateButton(text, func)
- if func == nil then
- func = function()
- print("no func added.")
- end
- end
- tabContent.contents = tabContent.contents+1
- local Button = Instance.new("Frame")
- local TextButton = Instance.new("TextButton")
- Button.Name = "Button"
- Button.Parent = content
- Button.BackgroundColor3 = Color3.new(0, 0, 0)
- Button.BackgroundTransparency = 0.5
- Button.BorderSizePixel = 0
- Button.Position = UDim2.new(0, 0, tabContent.contents, 0)
- Button.Size = UDim2.new(1, 0, 1, 0)
- TextButton.Parent = Button
- TextButton.BackgroundColor3 = Color3.new(0, 0, 0)
- TextButton.BackgroundTransparency = 0.5
- TextButton.BorderSizePixel = 0
- TextButton.Position = UDim2.new(0.05, 0, 0.125, 0)
- TextButton.Size = UDim2.new(0.9, 0, 0.75, 0)
- TextButton.ZIndex = 2
- TextButton.Font = Enum.Font.SourceSans
- TextButton.FontSize = Enum.FontSize.Size24
- TextButton.Text = text
- TextButton.TextColor3 = Color3.new(1, 1, 1)
- TextButton.TextSize = 20
- TextButton.TextWrapped = true
- TextButton.MouseButton1Down:connect(func)
- end
- function tabContent:CreateTextBox(text, tbid)
- tabContent.contents = tabContent.contents+1
- local TextBox = Instance.new("Frame")
- local TabLabelShadow = Instance.new("TextLabel")
- local TabLabel = Instance.new("TextLabel")
- local TextBox_2 = Instance.new("TextBox")
- TextBox.Name = "TextBox"
- TextBox.Parent = content
- TextBox.BackgroundColor3 = Color3.new(0, 0, 0)
- TextBox.BackgroundTransparency = 0.5
- TextBox.BorderSizePixel = 0
- TextBox.Position = UDim2.new(0, 0, tabContent.contents, 0)
- TextBox.Size = UDim2.new(1, 0, 1, 0)
- TabLabelShadow.Name = "TabLabelShadow"
- TabLabelShadow.Parent = TextBox
- TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabelShadow.BackgroundTransparency = 1
- TabLabelShadow.BorderSizePixel = 0
- TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
- TabLabelShadow.Size = UDim2.new(0.6, 0, 1, 0)
- TabLabelShadow.Font = Enum.Font.SourceSans
- TabLabelShadow.FontSize = Enum.FontSize.Size24
- TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
- TabLabelShadow.TextSize = 20
- TabLabelShadow.TextWrapped = true
- TabLabelShadow.Text = text
- TabLabel.Name = "TabLabel"
- TabLabel.Parent = TextBox
- TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabel.BackgroundTransparency = 1
- TabLabel.BorderSizePixel = 0
- TabLabel.Size = UDim2.new(0.6, 0, 1, 0)
- TabLabel.ZIndex = 2
- TabLabel.Font = Enum.Font.SourceSans
- TabLabel.FontSize = Enum.FontSize.Size24
- TabLabel.TextColor3 = Color3.new(1, 1, 1)
- TabLabel.TextSize = 20
- TabLabel.TextWrapped = true
- TabLabel.Text = text
- TextBox_2.Parent = TextBox
- TextBox_2.BackgroundColor3 = Color3.new(0, 0, 0)
- TextBox_2.BackgroundTransparency = 0.5
- TextBox_2.BorderSizePixel = 0
- TextBox_2.Position = UDim2.new(0.65, 0, 0.125, 0)
- TextBox_2.Size = UDim2.new(0.3, 0, 0.75, 0)
- TextBox_2.Font = Enum.Font.SourceSans
- TextBox_2.FontSize = Enum.FontSize.Size24
- TextBox_2.Text = "1234"
- TextBox_2.TextColor3 = Color3.new(1, 1, 1)
- TextBox_2.TextSize = 20
- TextBox_2.TextWrapped = true
- TextBox_2.FocusLost:connect(function()
- if lib.content[tbid] ~= nil then
- table.remove(lib.content, tbid)
- end
- table.insert(lib.content, tbid, TextBox_2.Text)
- end)
- end
- function tabContent:CreateToggle(text, tbid)
- tabContent.contents = tabContent.contents+1
- local Toggle = Instance.new("Frame")
- local TabLabelShadow = Instance.new("TextLabel")
- local TabLabel = Instance.new("TextLabel")
- local TextButton = Instance.new("TextButton")
- Toggle.Name = "Toggle"
- Toggle.Parent = content
- Toggle.BackgroundColor3 = Color3.new(0, 0, 0)
- Toggle.BackgroundTransparency = 0.5
- Toggle.BorderSizePixel = 0
- Toggle.Position = UDim2.new(0, 0, tabContent.contents, 0)
- Toggle.Size = UDim2.new(1, 0, 1, 0)
- TabLabelShadow.Name = "TabLabelShadow"
- TabLabelShadow.Parent = Toggle
- TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabelShadow.BackgroundTransparency = 1
- TabLabelShadow.BorderSizePixel = 0
- TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
- TabLabelShadow.Size = UDim2.new(0.7, 0, 1, 0)
- TabLabelShadow.Font = Enum.Font.SourceSans
- TabLabelShadow.FontSize = Enum.FontSize.Size24
- TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
- TabLabelShadow.TextSize = 20
- TabLabelShadow.TextWrapped = true
- TabLabel.Name = "TabLabel"
- TabLabel.Parent = Toggle
- TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabel.BackgroundTransparency = 1
- TabLabel.BorderSizePixel = 0
- TabLabel.Size = UDim2.new(0.7, 0, 1, 0)
- TabLabel.ZIndex = 2
- TabLabel.Font = Enum.Font.SourceSans
- TabLabel.FontSize = Enum.FontSize.Size24
- TabLabel.TextColor3 = Color3.new(1, 1, 1)
- TabLabel.TextSize = 20
- TabLabel.TextWrapped = true
- TextButton.Parent = Toggle
- TextButton.BackgroundColor3 = Color3.new(1, 0, 0)
- TextButton.BackgroundTransparency = 0.5
- TextButton.BorderSizePixel = 0
- TextButton.Position = UDim2.new(0.75, 0, 0.125, 0)
- TextButton.Size = UDim2.new(0.2, 0, 0.75, 0)
- TextButton.ZIndex = 2
- TextButton.Font = Enum.Font.SourceSans
- TextButton.FontSize = Enum.FontSize.Size24
- TextButton.Text = "OFF"
- TextButton.TextColor3 = Color3.new(1, 1, 1)
- TextButton.TextSize = 20
- TextButton.TextWrapped = true
- table.insert(lib.content, tbid, false)
- TextButton.MouseButton1Down:connect(function()
- if TextButton.Text == "OFF" then
- TextButton.Text = "ON"
- TextButton.BackgroundColor3 = Color3.new(0, 1, 0)
- if lib.content[tbid] ~= nil then
- table.remove(lib.content, tbid)
- end
- table.insert(lib.content, tbid, true)
- else
- TextButton.Text = "OFF"
- TextButton.BackgroundColor3 = Color3.new(1, 0, 0)
- if lib.content[tbid] ~= nil then
- table.remove(lib.content, tbid)
- end
- table.insert(lib.content, tbid, false)
- end
- end)
- end
- --[[
- function tabContent:CreateKeybind(text, func)
- local keybindgoal = nil
- local lastpressed = nil
- tabContent.contents = tabContent.contents+1
- if func == nil then
- func = function()
- print("no func added.")
- end
- end
- local Keybind = Instance.new("Frame")
- local TabLabelShadow = Instance.new("TextLabel")
- local TabLabel = Instance.new("TextLabel")
- local TextButton = Instance.new("TextButton")
- Keybind.Name = "Keybind"
- Keybind.Parent = content
- Keybind.BackgroundColor3 = Color3.new(0, 0, 0)
- Keybind.BackgroundTransparency = 0.5
- Keybind.BorderSizePixel = 0
- Keybind.Position = UDim2.new(0, 0, tabContent.contents, 0)
- Keybind.Size = UDim2.new(1, 0, 1, 0)
- TabLabelShadow.Name = "TabLabelShadow"
- TabLabelShadow.Parent = Keybind
- TabLabelShadow.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabelShadow.BackgroundTransparency = 1
- TabLabelShadow.BorderSizePixel = 0
- TabLabelShadow.Position = UDim2.new(0, 1, 0, 1)
- TabLabelShadow.Size = UDim2.new(0.7, 0, 1, 0)
- TabLabelShadow.Font = Enum.Font.SourceSans
- TabLabelShadow.FontSize = Enum.FontSize.Size24
- TabLabelShadow.TextColor3 = Color3.new(0, 0, 0)
- TabLabelShadow.TextSize = 20
- TabLabelShadow.TextWrapped = true
- TabLabel.Name = "TabLabel"
- TabLabel.Parent = Keybind
- TabLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TabLabel.BackgroundTransparency = 1
- TabLabel.BorderSizePixel = 0
- TabLabel.Size = UDim2.new(0.7, 0, 1, 0)
- TabLabel.ZIndex = 2
- TabLabel.Font = Enum.Font.SourceSans
- TabLabel.FontSize = Enum.FontSize.Size24
- TabLabel.TextColor3 = Color3.new(1, 1, 1)
- TabLabel.TextSize = 20
- TabLabel.TextWrapped = true
- TextButton.Parent = Keybind
- TextButton.BackgroundColor3 = Color3.new(0, 0, 0)
- TextButton.BackgroundTransparency = 0.5
- TextButton.BorderSizePixel = 0
- TextButton.Position = UDim2.new(0.65, 0, 0.125, 0)
- TextButton.Size = UDim2.new(0.3, 0, 0.75, 0)
- TextButton.ZIndex = 2
- TextButton.Font = Enum.Font.SourceSans
- TextButton.FontSize = Enum.FontSize.Size24
- TextButton.Text = "LeftCtrl"
- TextButton.TextColor3 = Color3.new(1, 1, 1)
- TextButton.TextSize = 20
- TextButton.MouseButton1Down:connect(function()
- end)
- mouse.KeyDown:connect(function(key)
- lastpressed = key
- end)
- end
- lib.tabs[63]:CreateKeybind("yes", function()
- print("testXD")
- end)
- --]]
- end
- local test = [[
- {
- "id": 63,
- "text": "test123",
- "colorRGB":
- {
- "r": 0,
- "g": 0,
- "b": 255
- }
- }
- ]]
- local tab = lib:CreateTab(test)
- lib.tabs[63]:CreateButton("print contents", function()
- print("textbox: " .. tostring(lib.content[33]))
- print("toggle: " .. tostring(lib.content[99]))
- end)
- lib.tabs[63]:CreateTextBox("textbox", 33)
- print(lib.content[33])
- lib.tabs[63]:CreateToggle("toggle", 99)
- print(lib.content[99])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement