Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local HirimiUI = {}
- HirimiUI.__index = HirimiUI
- local TweenService = game:GetService("TweenService")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local tweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- -- Helper function for Tween
- local function tween(obj, props)
- TweenService:Create(obj, tweenInfo, props):Play()
- end
- function HirimiUI:CreateWindow(title)
- local self = setmetatable({}, HirimiUI)
- -- ScreenGui
- self.ScreenGui = Instance.new("ScreenGui")
- self.ScreenGui.Name = "HirimiUI"
- self.ScreenGui.Parent = game.CoreGui
- self.ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- -- DropShadowHolder
- self.DropShadowHolder = Instance.new("Frame")
- self.DropShadowHolder.Name = "DropShadowHolder"
- self.DropShadowHolder.Size = UDim2.new(0, 455, 0, 350)
- self.DropShadowHolder.Position = UDim2.new(0.5, 0, 0.5, 0)
- self.DropShadowHolder.AnchorPoint = Vector2.new(0.5, 0.5)
- self.DropShadowHolder.BackgroundTransparency = 1
- self.DropShadowHolder.ZIndex = 1
- self.DropShadowHolder.Parent = self.ScreenGui
- -- DropShadow
- local DropShadow = Instance.new("ImageLabel")
- DropShadow.Name = "DropShadow"
- DropShadow.Image = "rbxassetid://6015897843"
- DropShadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
- DropShadow.ImageTransparency = 0.6
- DropShadow.ScaleType = Enum.ScaleType.Slice
- DropShadow.SliceCenter = Rect.new(49, 49, 450, 450)
- DropShadow.AnchorPoint = Vector2.new(0.5, 0.5)
- DropShadow.Position = UDim2.new(0.5, 0, 0.5, 0)
- DropShadow.Size = UDim2.new(1, 50, 1, 50)
- DropShadow.BackgroundTransparency = 1
- DropShadow.ZIndex = 1
- DropShadow.Parent = self.DropShadowHolder
- -- MainFrame
- self.MainFrame = Instance.new("Frame")
- self.MainFrame.Name = "MainWindow"
- self.MainFrame.Size = UDim2.new(0, 455, 0, 350)
- self.MainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
- self.MainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
- self.MainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- self.MainFrame.BorderSizePixel = 0
- self.MainFrame.ClipsDescendants = true
- self.MainFrame.ZIndex = 2
- self.MainFrame.Parent = self.ScreenGui
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 12)
- UICorner.Parent = self.MainFrame
- local UIGradient = Instance.new("UIGradient")
- UIGradient.Color = ColorSequence.new{
- ColorSequenceKeypoint.new(0, Color3.fromRGB(30, 30, 30)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(15, 15, 15))
- }
- UIGradient.Rotation = 90
- UIGradient.Parent = self.MainFrame
- -- TitleBar
- self.TitleBar = Instance.new("Frame")
- self.TitleBar.Size = UDim2.new(1, 0, 0, 40)
- self.TitleBar.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
- self.TitleBar.BorderSizePixel = 0
- self.TitleBar.ZIndex = 3
- self.TitleBar.Parent = self.MainFrame
- local Title = Instance.new("TextLabel")
- Title.Text = title or "Hirimi UI"
- Title.Font = Enum.Font.GothamBold
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextSize = 16
- Title.BackgroundTransparency = 1
- Title.Size = UDim2.new(1, -80, 1, 0)
- Title.Position = UDim2.new(0, 15, 0, 0)
- Title.TextXAlignment = Enum.TextXAlignment.Left
- Title.ZIndex = 4
- Title.Parent = self.TitleBar
- -- Minimize Button
- self.MinimizeButton = Instance.new("TextButton")
- self.MinimizeButton.Text = "-"
- self.MinimizeButton.Font = Enum.Font.GothamBold
- self.MinimizeButton.TextColor3 = Color3.fromRGB(255, 255, 0)
- self.MinimizeButton.TextSize = 20
- self.MinimizeButton.BackgroundTransparency = 1
- self.MinimizeButton.Size = UDim2.new(0, 40, 1, 0)
- self.MinimizeButton.Position = UDim2.new(1, -80, 0, 0)
- self.MinimizeButton.ZIndex = 4
- self.MinimizeButton.Parent = self.TitleBar
- self.Minimized = false
- self.MinimizeButton.MouseButton1Click:Connect(function()
- self:ToggleMinimize()
- end)
- -- Close Button
- local CloseButton = Instance.new("TextButton")
- CloseButton.Text = "×"
- CloseButton.Font = Enum.Font.GothamBold
- CloseButton.TextColor3 = Color3.fromRGB(255, 100, 100)
- CloseButton.TextSize = 20
- CloseButton.BackgroundTransparency = 1
- CloseButton.Size = UDim2.new(0, 40, 1, 0)
- CloseButton.Position = UDim2.new(1, -40, 0, 0)
- CloseButton.ZIndex = 4
- CloseButton.Parent = self.TitleBar
- CloseButton.MouseButton1Click:Connect(function()
- self.ScreenGui:Destroy()
- end)
- CloseButton.MouseEnter:Connect(function()
- CloseButton.TextColor3 = Color3.fromRGB(255, 50, 50)
- end)
- CloseButton.MouseLeave:Connect(function()
- CloseButton.TextColor3 = Color3.fromRGB(255, 100, 100)
- end)
- -- Tab Container
- self.TabContainer = Instance.new("Frame")
- self.TabContainer.Size = UDim2.new(1, 0, 0, 40)
- self.TabContainer.Position = UDim2.new(0, 0, 0, 40)
- self.TabContainer.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
- self.TabContainer.BorderSizePixel = 0
- self.TabContainer.ZIndex = 3
- self.TabContainer.Parent = self.MainFrame
- self.TabLayout = Instance.new("UIListLayout")
- self.TabLayout.FillDirection = Enum.FillDirection.Horizontal
- self.TabLayout.SortOrder = Enum.SortOrder.LayoutOrder
- self.TabLayout.Padding = UDim.new(0, 5)
- self.TabLayout.Parent = self.TabContainer
- -- Content Frame
- self.ContentFrame = Instance.new("Frame")
- self.ContentFrame.Size = UDim2.new(1, 0, 1, -80)
- self.ContentFrame.Position = UDim2.new(0, 0, 0, 80)
- self.ContentFrame.BackgroundTransparency = 1
- self.ContentFrame.ZIndex = 3
- self.ContentFrame.Parent = self.MainFrame
- self.Tabs = {}
- self.CurrentTab = nil
- -- Draggable
- self.Dragging = false
- self.DragStart = nil
- self.StartPos = nil
- self.TitleBar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- self.Dragging = true
- self.DragStart = input.Position
- self.StartPos = self.MainFrame.Position
- tween(self.MainFrame, {Size = UDim2.new(0, 460, 0, 355)})
- end
- end)
- self.TitleBar.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- self.Dragging = false
- tween(self.MainFrame, {Size = UDim2.new(0, 455, 0, 350)})
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if self.Dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- local delta = input.Position - self.DragStart
- local newPos = UDim2.new(self.StartPos.X.Scale, self.StartPos.X.Offset + delta.X, self.StartPos.Y.Scale, self.StartPos.Y.Offset + delta.Y)
- self.MainFrame.Position = newPos
- self.DropShadowHolder.Position = newPos
- end
- end)
- -- Notification Holder
- self.NotificationHolder = Instance.new("Frame")
- self.NotificationHolder.Size = UDim2.new(0, 300, 1, 0)
- self.NotificationHolder.Position = UDim2.new(1, -310, 0, 0)
- self.NotificationHolder.BackgroundTransparency = 1
- self.NotificationHolder.ZIndex = 10
- self.NotificationHolder.Parent = self.ScreenGui
- local UIListLayout = Instance.new("UIListLayout")
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- UIListLayout.VerticalAlignment = Enum.VerticalAlignment.Bottom
- UIListLayout.Padding = UDim.new(0, 10)
- UIListLayout.Parent = self.NotificationHolder
- return self
- end
- function HirimiUI:ToggleMinimize()
- self.Minimized = not self.Minimized
- if self.Minimized then
- tween(self.MainFrame, {Size = UDim2.new(0, 455, 0, 40)})
- self.TabContainer.Visible = false
- self.ContentFrame.Visible = false
- self.MinimizeButton.Text = "+"
- else
- tween(self.MainFrame, {Size = UDim2.new(0, 455, 0, 350)})
- self.TabContainer.Visible = true
- self.ContentFrame.Visible = true
- self.MinimizeButton.Text = "-"
- end
- tween(self.DropShadowHolder, {Size = self.MainFrame.Size})
- end
- function HirimiUI:CreateTab(name)
- local TabButton = Instance.new("TextButton")
- TabButton.Text = name
- TabButton.Font = Enum.Font.Gotham
- TabButton.TextColor3 = Color3.fromRGB(200, 200, 200)
- TabButton.TextSize = 14
- TabButton.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
- TabButton.Size = UDim2.new(0, 100, 1, 0)
- TabButton.AutoButtonColor = false
- TabButton.ZIndex = 4
- TabButton.Parent = self.TabContainer
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 6)
- UICorner.Parent = TabButton
- local TabContent = Instance.new("ScrollingFrame")
- TabContent.Size = UDim2.new(1, 0, 1, 0)
- TabContent.BackgroundTransparency = 1
- TabContent.BorderSizePixel = 0
- TabContent.ScrollBarThickness = 4
- TabContent.Visible = false
- TabContent.ZIndex = 4
- TabContent.Parent = self.ContentFrame
- local UIListLayout = Instance.new("UIListLayout")
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- UIListLayout.Padding = UDim.new(0, 5)
- UIListLayout.Parent = TabContent
- local UIPadding = Instance.new("UIPadding")
- UIPadding.PaddingTop = UDim.new(0, 10)
- UIPadding.PaddingLeft = UDim.new(0, 10)
- UIPadding.PaddingRight = UDim.new(0, 10)
- UIPadding.Parent = TabContent
- TabButton.MouseButton1Click:Connect(function()
- for _, tab in pairs(self.Tabs) do
- tab.Content.Visible = false
- tween(tab.Button, {BackgroundColor3 = Color3.fromRGB(35, 35, 35), TextColor3 = Color3.fromRGB(200, 200, 200)})
- end
- TabContent.Visible = true
- tween(TabButton, {BackgroundColor3 = Color3.fromRGB(50, 50, 50), TextColor3 = Color3.fromRGB(255, 255, 255)})
- self.CurrentTab = TabContent
- end)
- table.insert(self.Tabs, {Button = TabButton, Content = TabContent})
- if #self.Tabs == 1 then
- TabButton:SimulateClick() -- Open first tab by default
- end
- local Tab = {}
- Tab.__index = Tab
- function Tab:CreateButton(text, callback)
- local Button = Instance.new("TextButton")
- Button.Text = text
- Button.Font = Enum.Font.Gotham
- Button.TextColor3 = Color3.fromRGB(255, 255, 255)
- Button.TextSize = 14
- Button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- Button.Size = UDim2.new(1, 0, 0, 30)
- Button.ZIndex = 5
- Button.Parent = TabContent
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 6)
- UICorner.Parent = Button
- Button.MouseEnter:Connect(function()
- tween(Button, {BackgroundColor3 = Color3.fromRGB(60, 60, 60)})
- end)
- Button.MouseLeave:Connect(function()
- tween(Button, {BackgroundColor3 = Color3.fromRGB(40, 40, 40)})
- end)
- Button.MouseButton1Click:Connect(function()
- tween(Button, {Size = UDim2.new(1, 0, 0, 28)})
- wait(0.1)
- tween(Button, {Size = UDim2.new(1, 0, 0, 30)})
- callback()
- end)
- end
- function Tab:CreateToggle(text, default, callback)
- local ToggleFrame = Instance.new("Frame")
- ToggleFrame.Size = UDim2.new(1, 0, 0, 30)
- ToggleFrame.BackgroundTransparency = 1
- ToggleFrame.ZIndex = 5
- ToggleFrame.Parent = TabContent
- local Label = Instance.new("TextLabel")
- Label.Text = text
- Label.Font = Enum.Font.Gotham
- Label.TextColor3 = Color3.fromRGB(255, 255, 255)
- Label.TextSize = 14
- Label.BackgroundTransparency = 1
- Label.Size = UDim2.new(1, -50, 1, 0)
- Label.TextXAlignment = Enum.TextXAlignment.Left
- Label.Parent = ToggleFrame
- local ToggleButton = Instance.new("Frame")
- ToggleButton.Size = UDim2.new(0, 40, 0, 20)
- ToggleButton.Position = UDim2.new(1, -40, 0.5, -10)
- ToggleButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- ToggleButton.Parent = ToggleFrame
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 10)
- UICorner.Parent = ToggleButton
- local Knob = Instance.new("Frame")
- Knob.Size = UDim2.new(0, 20, 1, 0)
- Knob.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
- Knob.Parent = ToggleButton
- local UICornerKnob = Instance.new("UICorner")
- UICornerKnob.CornerRadius = UDim.new(0, 10)
- UICornerKnob.Parent = Knob
- local enabled = default
- if enabled then
- Knob.Position = UDim2.new(0.5, 0, 0, 0)
- ToggleButton.BackgroundColor3 = Color3.fromRGB(100, 150, 255)
- end
- ToggleFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- enabled = not enabled
- callback(enabled)
- if enabled then
- tween(Knob, {Position = UDim2.new(0.5, 0, 0, 0)})
- tween(ToggleButton, {BackgroundColor3 = Color3.fromRGB(100, 150, 255)})
- else
- tween(Knob, {Position = UDim2.new(0, 0, 0, 0)})
- tween(ToggleButton, {BackgroundColor3 = Color3.fromRGB(40, 40, 40)})
- end
- end
- end)
- end
- function Tab:CreateDropdown(text, options, callback)
- local DropdownFrame = Instance.new("Frame")
- DropdownFrame.Size = UDim2.new(1, 0, 0, 30)
- DropdownFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- DropdownFrame.ZIndex = 5
- DropdownFrame.Parent = TabContent
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 6)
- UICorner.Parent = DropdownFrame
- local Label = Instance.new("TextLabel")
- Label.Text = text
- Label.Font = Enum.Font.Gotham
- Label.TextColor3 = Color3.fromRGB(200, 200, 200)
- Label.TextSize = 14
- Label.BackgroundTransparency = 1
- Label.Size = UDim2.new(1, -30, 1, 0)
- Label.Position = UDim2.new(0, 10, 0, 0)
- Label.TextXAlignment = Enum.TextXAlignment.Left
- Label.Parent = DropdownFrame
- local Arrow = Instance.new("TextLabel")
- Arrow.Text = "▼"
- Arrow.Font = Enum.Font.Gotham
- Arrow.TextColor3 = Color3.fromRGB(200, 200, 200)
- Arrow.TextSize = 14
- Arrow.BackgroundTransparency = 1
- Arrow.Size = UDim2.new(0, 30, 1, 0)
- Arrow.Position = UDim2.new(1, -30, 0, 0)
- Arrow.Parent = DropdownFrame
- local OptionList = Instance.new("Frame")
- OptionList.Size = UDim2.new(1, 0, 0, 0)
- OptionList.Position = UDim2.new(0, 0, 1, 0)
- OptionList.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- OptionList.Visible = false
- OptionList.ClipsDescendants = true
- OptionList.ZIndex = 6
- OptionList.Parent = DropdownFrame
- local UIListLayout = Instance.new("UIListLayout")
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- UIListLayout.Parent = OptionList
- local UICornerList = Instance.new("UICorner")
- UICornerList.CornerRadius = UDim.new(0, 6)
- UICornerList.Parent = OptionList
- for _, opt in pairs(options) do
- local OptButton = Instance.new("TextButton")
- OptButton.Text = opt
- OptButton.Font = Enum.Font.Gotham
- OptButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- OptButton.TextSize = 14
- OptButton.BackgroundTransparency = 1
- OptButton.Size = UDim2.new(1, 0, 0, 30)
- OptButton.ZIndex = 7
- OptButton.Parent = OptionList
- OptButton.MouseButton1Click:Connect(function()
- Label.Text = text .. ": " .. opt
- callback(opt)
- tween(OptionList, {Size = UDim2.new(1, 0, 0, 0)})
- OptionList.Visible = false
- end)
- OptButton.MouseEnter:Connect(function()
- tween(OptButton, {BackgroundTransparency = 0.8})
- end)
- OptButton.MouseLeave:Connect(function()
- tween(OptButton, {BackgroundTransparency = 1})
- end)
- end
- DropdownFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- if OptionList.Visible then
- tween(OptionList, {Size = UDim2.new(1, 0, 0, 0)})
- OptionList.Visible = false
- else
- OptionList.Size = UDim2.new(1, 0, 0, #options * 30)
- OptionList.Visible = true
- tween(OptionList, {Size = UDim2.new(1, 0, 0, #options * 30)})
- end
- end
- end)
- end
- function Tab:CreateSlider(text, min, max, default, callback)
- local SliderFrame = Instance.new("Frame")
- SliderFrame.Size = UDim2.new(1, 0, 0, 50)
- SliderFrame.BackgroundTransparency = 1
- SliderFrame.ZIndex = 5
- SliderFrame.Parent = TabContent
- local Label = Instance.new("TextLabel")
- Label.Text = text .. ": " .. default
- Label.Font = Enum.Font.Gotham
- Label.TextColor3 = Color3.fromRGB(255, 255, 255)
- Label.TextSize = 14
- Label.BackgroundTransparency = 1
- Label.Size = UDim2.new(1, 0, 0, 20)
- Label.Parent = SliderFrame
- local SliderBar = Instance.new("Frame")
- SliderBar.Size = UDim2.new(1, 0, 0, 10)
- SliderBar.Position = UDim2.new(0, 0, 0, 25)
- SliderBar.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
- SliderBar.Parent = SliderFrame
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 5)
- UICorner.Parent = SliderBar
- local Fill = Instance.new("Frame")
- Fill.Size = UDim2.new((default - min) / (max - min), 0, 1, 0)
- Fill.BackgroundColor3 = Color3.fromRGB(100, 150, 255)
- Fill.Parent = SliderBar
- local UICornerFill = Instance.new("UICorner")
- UICornerFill.CornerRadius = UDim.new(0, 5)
- UICornerFill.Parent = Fill
- local Dragging = false
- SliderBar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- Dragging = true
- end
- end)
- SliderBar.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- Dragging = false
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if Dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local relativeX = math.clamp((input.Position.X - SliderBar.AbsolutePosition.X) / SliderBar.AbsoluteSize.X, 0, 1)
- local value = math.floor(min + relativeX * (max - min))
- Fill.Size = UDim2.new(relativeX, 0, 1, 0)
- Label.Text = text .. ": " .. value
- callback(value)
- end
- end)
- end
- function Tab:CreateText(text)
- local TextLabel = Instance.new("TextLabel")
- TextLabel.Text = text
- TextLabel.Font = Enum.Font.Gotham
- TextLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
- TextLabel.TextSize = 14
- TextLabel.BackgroundTransparency = 1
- TextLabel.Size = UDim2.new(1, 0, 0, 20)
- TextLabel.TextWrapped = true
- TextLabel.ZIndex = 5
- TextLabel.Parent = TabContent
- end
- return Tab
- end
- function HirimiUI:CreateNotification(title, desc, duration)
- local NotifFrame = Instance.new("Frame")
- NotifFrame.Size = UDim2.new(1, 0, 0, 60)
- NotifFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- NotifFrame.BorderSizePixel = 0
- NotifFrame.ZIndex = 11
- NotifFrame.Parent = self.NotificationHolder
- local UICorner = Instance.new("UICorner")
- UICorner.CornerRadius = UDim.new(0, 8)
- UICorner.Parent = NotifFrame
- local Title = Instance.new("TextLabel")
- Title.Text = title
- Title.Font = Enum.Font.GothamBold
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.TextSize = 14
- Title.BackgroundTransparency = 1
- Title.Size = UDim2.new(1, -10, 0, 20)
- Title.Position = UDim2.new(0, 10, 0, 5)
- Title.Parent = NotifFrame
- local Desc = Instance.new("TextLabel")
- Desc.Text = desc
- Desc.Font = Enum.Font.Gotham
- Desc.TextColor3 = Color3.fromRGB(200, 200, 200)
- Desc.TextSize = 12
- Desc.BackgroundTransparency = 1
- Desc.Size = UDim2.new(1, -10, 0, 30)
- Desc.Position = UDim2.new(0, 10, 0, 25)
- Desc.Parent = NotifFrame
- NotifFrame.Position = UDim2.new(0, 300, 0, 0) -- Start off-screen
- tween(NotifFrame, {Position = UDim2.new(0, 0, 0, 0)})
- task.delay(duration or 3, function()
- tween(NotifFrame, {Position = UDim2.new(0, 300, 0, 0)})
- wait(0.3)
- NotifFrame:Destroy()
- end)
- end
- return HirimiUI
Advertisement
Add Comment
Please, Sign In to add comment