Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screen = Instance.new("ScreenGui",game:GetService("CoreGui"))
- local mouse = game:GetService("Players").LocalPlayer:GetMouse()
- local mainui = {
- frames = 0;
- buttonsize = 20;
- t = true,
- }
- local colors = {
- barcolor = Color3.fromRGB(170, 0, 127)
- }
- function mainui:AddWindow(n,c)
- local top = Instance.new("Frame",screen)
- local bframe = Instance.new("Frame")
- local main = Instance.new("ImageLabel")
- local UIListLayout = Instance.new("UIListLayout",main)
- local bar = Instance.new("Frame")
- local text = Instance.new("TextLabel")
- local x = c or 0
- top.Name = "top"
- top.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
- top.BorderSizePixel = 0
- top.Position = UDim2.new(0, 20+(210*self.frames), 0, 15)
- top.Size = UDim2.new(0, 200, 0, 39)
- bframe.Name = "bframe"
- bframe.Parent = top
- bframe.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
- bframe.BorderColor3 = Color3.new(0.666667, 0, 0.498039)
- bframe.BorderSizePixel = 0
- bframe.ClipsDescendants = true
- bframe.Position = UDim2.new(-0.00045085547, 0, 0.999999583, 0)
- bframe.Size = UDim2.new(0, 200, 0, (self.buttonsize*x))
- main.Name = "main"
- main.Parent = bframe
- main.BackgroundColor3 = Color3.new(1, 1, 1)
- main.BackgroundTransparency = 1
- main.Position = UDim2.new(-7.59143717e-08, 0, -1.12196979e-07, 0)
- main.Size = UDim2.new(0, 907, 0, 833)
- main.Image = "rbxassetid://3343671401"
- main.ImageTransparency = 0.89999997615814
- bar.Name = "bar"
- bar.Parent = top
- bar.BackgroundColor3 = Color3.new(0.666667, 0, 0.498039)
- bar.BorderSizePixel = 0
- bar.Position = UDim2.new(0, 0, 0.923076928, 0)
- bar.Size = UDim2.new(0, 200, 0, 3)
- text.Name = "text"
- text.Parent = top
- text.BackgroundColor3 = Color3.new(1, 1, 1)
- text.BackgroundTransparency = 1
- text.Size = UDim2.new(0, 200, 0, 36)
- text.Font = Enum.Font.Code
- text.Text = n
- text.TextColor3 = Color3.new(1, 1, 1)
- text.TextSize = 18
- self.frames = self.frames +1
- return main
- end
- function mainui:AddToggle(txt,p)
- local b = Instance.new("TextButton")
- local label = Instance.new("TextLabel")
- b.Name = "b"
- b.Parent = p
- b.BackgroundTransparency = 1
- b.Size = UDim2.new(0, 200, 0, self.buttonsize)
- b.Font = Enum.Font.SourceSans
- b.Text = txt
- b.TextColor3 = Color3.new(1, 1, 1)
- b.TextSize = 16
- b.TextXAlignment = Enum.TextXAlignment.Left
- label.Name = "label"
- label.Parent = b
- label.BackgroundTransparency = 1
- label.Position = UDim2.new(0.890547276, 0, 0, 0)
- label.Size = UDim2.new(0, 21, 0, 20)
- label.Font = Enum.Font.Code
- label.Text = "OFF"
- label.TextColor3 = Color3.new(1,0,0)
- label.TextSize = 14
- return b,label
- end
- function mainui:AddBox(t,b,p)
- local a = Instance.new("TextBox")
- a.Name = "a"
- a.Parent = p
- a.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
- a.BorderSizePixel = 0
- a.Size = UDim2.new(0, 200, 0, 20)
- a.Font = Enum.Font.SourceSans
- a.PlaceholderColor3 = Color3.new(1, 1, 1)
- a.Text = t
- a.PlaceholderText = b
- a.TextColor3 = Color3.new(1, 1, 1)
- a.TextSize = 16
- a.TextStrokeColor3 = Color3.new(1, 1, 1)
- a.TextXAlignment = Enum.TextXAlignment.Left
- a.TextTransparency = 0.4
- return a
- end
- function mainui:AddButton(txt,p)
- local x = Instance.new("TextButton")
- x.Name = "x"
- x.Parent = p
- x.BackgroundTransparency = 1
- x.BorderSizePixel = 0
- x.Size = UDim2.new(0, 200, 0, 20)
- x.Font = Enum.Font.SourceSans
- x.Text = txt
- x.TextColor3 = Color3.new(1, 1, 1)
- x.TextSize = 16
- x.TextXAlignment = Enum.TextXAlignment.Left
- return x
- end
- function mainui:AddText(txt,p)
- local x = Instance.new("TextLabel")
- x.Name = "x"
- x.Parent = p
- x.BackgroundTransparency = 1
- x.BorderSizePixel = 0
- x.Size = UDim2.new(0, 200, 0, 20)
- x.Font = Enum.Font.SourceSans
- x.Text = txt
- x.TextColor3 = Color3.new(1, 1, 1)
- x.TextSize = 16
- x.TextXAlignment = Enum.TextXAlignment.Left
- return x
- end
- function mainui:AddSlider(txt,p)
- local SliderB = Instance.new("Frame")
- local Text = Instance.new("TextLabel")
- local Count = Instance.new("TextLabel")
- local Frame = Instance.new("Frame")
- local Background = Instance.new("Frame")
- local SliderObject = Instance.new("TextButton")
- --Properties:
- SliderB.Name = "SliderB"
- SliderB.Parent = p
- SliderB.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
- SliderB.BackgroundTransparency = 1
- SliderB.BorderSizePixel = 0
- SliderB.Position = UDim2.new(0.0989583284, 0, 0.404176891, 0)
- SliderB.Size = UDim2.new(0, 200, 0, 20)
- Text.Name = txt
- Text.Parent = SliderB
- Text.BackgroundColor3 = Color3.new(1, 1, 1)
- Text.BackgroundTransparency = 1
- Text.BorderSizePixel = 0
- Text.Size = UDim2.new(0, 82, 0, 20)
- Text.Font = Enum.Font.SourceSans
- Text.TextColor3 = Color3.new(1, 1, 1)
- Text.TextSize = 16
- Text.TextWrapped = true
- Text.TextXAlignment = Enum.TextXAlignment.Left
- Count.Name = "Count"
- Count.Parent = SliderB
- Count.BackgroundColor3 = Color3.new(1, 1, 1)
- Count.BackgroundTransparency = 1
- Count.Position = UDim2.new(0.399999976, 0, -0.0500000007, 0)
- Count.Size = UDim2.new(0, 20, 0, 20)
- Count.Font = Enum.Font.SourceSans
- Count.Text = "0"
- Count.TextColor3 = Color3.new(1, 1, 1)
- Count.TextSize = 16
- Frame.Parent = SliderB
- Frame.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame.BorderSizePixel = 0
- Frame.Position = UDim2.new(0.535000026, 0, 0.426315308, 0)
- Frame.Size = UDim2.new(0, 92, 0, 2)
- Background.Name = "Background"
- Background.Parent = Frame
- Background.BackgroundColor3 = Color3.new(1, 1, 1)
- Background.BackgroundTransparency = 1
- Background.BorderColor3 = Color3.new(1, 1, 1)
- Background.BorderSizePixel = 0
- Background.Position = UDim2.new(1.0869565, -100, 0.736846924, -10)
- Background.Size = UDim2.new(0, 90, 0, 19)
- SliderObject.Name = "SliderObject"
- SliderObject.Parent = Background
- SliderObject.BackgroundColor3 = Color3.new(0.666667, 0, 1)
- SliderObject.BorderColor3 = Color3.new(0, 0, 0)
- SliderObject.BorderSizePixel = 0
- SliderObject.Size = UDim2.new(0, 7, 1.05263078, 0)
- SliderObject.AutoButtonColor = false
- SliderObject.Font = Enum.Font.ArialBold
- SliderObject.Text = ""
- SliderObject.TextColor3 = Color3.new(0, 0, 0)
- SliderObject.TextScaled = true
- SliderObject.TextSize = 96
- SliderObject.TextWrapped = true
- local Container = Background
- local Slider = SliderObject
- local Dragging
- Slider.MouseButton1Down:connect(function()
- Dragging = true
- end)
- mouse.Button1Up:connect(function()
- Dragging = false
- end)
- local function ClampAndTweenPosition(Position)
- local FinalPosition = Position
- if (FinalPosition.X.Offset < 0) then
- FinalPosition = UDim2.new(0, 0, 0, 0)
- elseif (FinalPosition.X.Offset > Container.AbsoluteSize.X) then
- FinalPosition = UDim2.new(1, -Slider.AbsoluteSize.X, 0, 0)
- end
- Slider:TweenPosition(
- FinalPosition,
- Enum.EasingDirection.InOut,
- Enum.EasingStyle.Linear,
- 0.1,
- true
- )
- end
- game:GetService("UserInputService").InputChanged:connect(function(InputObject, GameProcessedEvent)
- if ((not GameProcessedEvent) and Dragging) then
- if (InputObject.UserInputType == Enum.UserInputType.MouseMovement) then
- ClampAndTweenPosition(
- UDim2.new(
- 0,
- (InputObject.Position.X - Container.AbsolutePosition.X),
- 0,
- 0
- )
- )
- end
- end
- end)
- return SliderObject,Frame,Count
- end
- function onKeyPress(actionName, userInputState, inputObject)
- if userInputState == Enum.UserInputState.Begin then
- if mainui.t == false then
- mainui.t = true
- screen.Enabled = true
- else
- mainui.t = false
- screen.Enabled = false
- end
- end
- end
- game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.RightShift)
- return mainui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement