Advertisement
C-H-4-0-S

Loader part 1

Aug 20th, 2024
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. -- Get the required services
  2. local TweenService = game:GetService("TweenService")
  3. local RunService = game:GetService("RunService") -- To update colors every frame
  4.  
  5. -- Create a new ScreenGui
  6. local GUI = Instance.new("ScreenGui")
  7. GUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  8.  
  9. -- Create the main frame
  10. local MainFrame = Instance.new("Frame")
  11. MainFrame.Size = UDim2.new(0, 200, 0, 60)
  12. MainFrame.Position = UDim2.new(0, -200, 0.95, -60) -- Start off-screen
  13. MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  14. MainFrame.Parent = GUI
  15.  
  16. -- Round the corners of the main frame
  17. local MainFrameCorner = Instance.new("UICorner")
  18. MainFrameCorner.CornerRadius = UDim.new(0, 10)
  19. MainFrameCorner.Parent = MainFrame
  20.  
  21. -- Create the notification frame
  22. local NotificationFrame = Instance.new("Frame")
  23. NotificationFrame.Size = UDim2.new(0.9, 0, 0.8, 0)
  24. NotificationFrame.Position = UDim2.new(0.05, 0, 0.1, 0)
  25. NotificationFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) -- Darker gray
  26. NotificationFrame.Parent = MainFrame
  27.  
  28. -- Round the corners of the notification frame
  29. local NotificationFrameCorner = Instance.new("UICorner")
  30. NotificationFrameCorner.CornerRadius = UDim.new(0, 10)
  31. NotificationFrameCorner.Parent = NotificationFrame
  32.  
  33. -- Create the text label
  34. local TextLabel = Instance.new("TextLabel")
  35. TextLabel.Size = UDim2.new(0.9, 0, 0.7, 0)
  36. TextLabel.Position = UDim2.new(0.05, 0, 0.15, 0)
  37. TextLabel.BackgroundTransparency = 1
  38. TextLabel.TextScaled = true
  39. TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  40. TextLabel.TextYAlignment = Enum.TextYAlignment.Top
  41. TextLabel.Text = "Loaded!"
  42. TextLabel.Parent = NotificationFrame
  43.  
  44. -- Create the progress bar
  45. local ProgressBar = Instance.new("Frame")
  46. ProgressBar.Size = UDim2.new(0.9, 0, 0.1, 0)
  47. ProgressBar.Position = UDim2.new(0.05, 0, 0.85, 0)
  48. ProgressBar.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  49. ProgressBar.Parent = NotificationFrame
  50.  
  51. -- Create the progress bar fill
  52. local ProgressBarFill = Instance.new("Frame")
  53. ProgressBarFill.Size = UDim2.new(1, 0, 1, 0)
  54. ProgressBarFill.BackgroundColor3 = Color3.fromRGB(255, 165, 0) -- Orange
  55. ProgressBarFill.Parent = ProgressBar
  56.  
  57. -- Function to generate rainbow colors
  58. local function RainbowColor(hue)
  59. return Color3.fromHSV(hue, 1, 1)
  60. end
  61.  
  62. -- Function to show the notification
  63. local function ShowNotification()
  64. local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  65. local endPosition = UDim2.new(0.01, 0, 0.95, -60)
  66. local tween = TweenService:Create(MainFrame, tweenInfo, { Position = endPosition })
  67. tween:Play()
  68.  
  69. -- Start the progress bar countdown
  70. local countdownTime = 6 -- Countdown time in seconds
  71. local startTime = tick()
  72.  
  73. while tick() - startTime < countdownTime do
  74. local elapsedTime = tick() - startTime
  75. local progress = 1 - (elapsedTime / countdownTime)
  76. ProgressBarFill:TweenSize(UDim2.new(progress, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  77.  
  78. -- Calculate the hue based on the elapsed time to create a rainbow effect
  79. local hue = (elapsedTime % 1) / 1 -- Cycle through hues
  80. local rainbowColor = RainbowColor(hue)
  81.  
  82. -- Update the text and progress bar fill colors
  83. TextLabel.TextColor3 = rainbowColor
  84. ProgressBarFill.BackgroundColor3 = rainbowColor
  85.  
  86. task.wait(0.1) -- Wait a short time before the next color update
  87. end
  88.  
  89. -- Hide the notification
  90. local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
  91. local startPosition = UDim2.new(0.01, 0, 0.95, -60)
  92. local endPosition = UDim2.new(-1, 0, 0.95, -60)
  93. local tween = TweenService:Create(MainFrame, tweenInfo, { Position = endPosition })
  94. tween:Play()
  95. end
  96.  
  97. -- Trigger the notification
  98. ShowNotification()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement