Advertisement
AERQ1111

ROBLOX Speed Notifier GUI Script

Feb 26th, 2025 (edited)
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.18 KB | None | 0 0
  1. -- Speed Notifier GUI, Updates every 0.25 seconds.
  2. local player = game.Players.LocalPlayer
  3. local starterGui = game:GetService("StarterGui")
  4. local runService = game:GetService("RunService")
  5.  
  6. -- Create the GUI
  7. local function createSpeedNotifier()
  8.     -- Check if GUI already exists and remove it to avoid duplicates
  9.     if player:FindFirstChild("PlayerGui") then
  10.         local existingGui = player.PlayerGui:FindFirstChild("SpeedNotifier")
  11.         if existingGui then
  12.             existingGui:Destroy()
  13.         end
  14.     end
  15.  
  16.     local screenGui = Instance.new("ScreenGui")
  17.     screenGui.Name = "SpeedNotifier"
  18.     screenGui.ResetOnSpawn = false -- Prevents GUI from disappearing and changed on respawn
  19.     screenGui.Parent = player:WaitForChild("PlayerGui")
  20.  
  21.     local frame = Instance.new("Frame")
  22.     frame.Size = UDim2.new(0.3, 0, 0.1, 0)
  23.     frame.Position = UDim2.new(0.35, 0, 0.05, 0)
  24.     frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35) -- Slightly white but mostly black color
  25.     frame.BorderSizePixel = 2 -- Added outline
  26.     frame.BorderColor3 = Color3.fromRGB(255, 255, 255) -- White outline
  27.     frame.Active = true
  28.     frame.Draggable = true -- Makes the GUI moveable
  29.     frame.Parent = screenGui
  30.  
  31.     local textLabel = Instance.new("TextLabel")
  32.     textLabel.Size = UDim2.new(1, 0, 0.7, 0)
  33.     textLabel.Position = UDim2.new(0, 0, 0, 0)
  34.     textLabel.BackgroundTransparency = 1
  35.     textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  36.     textLabel.TextScaled = false
  37.     textLabel.TextSize = 45 -- Increased text size
  38.     textLabel.Font = Enum.Font.SourceSansBold
  39.     textLabel.Parent = frame
  40.  
  41.     local subTextLabel = Instance.new("TextLabel")
  42.     subTextLabel.Size = UDim2.new(1, 0, 0.3, 0)
  43.     subTextLabel.Position = UDim2.new(0, 0, 0.6, 0)
  44.     subTextLabel.BackgroundTransparency = 1
  45.     subTextLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
  46.     subTextLabel.TextSize = 20
  47.     subTextLabel.TextScaled = false
  48.     subTextLabel.Font = Enum.Font.SourceSans
  49.     subTextLabel.Text = "[IGNORES VELOCITY.]"
  50.     subTextLabel.Parent = frame
  51.  
  52.     -- Function to update speed
  53.     runService.RenderStepped:Connect(function()
  54.         local character = player.Character
  55.         if character and character:FindFirstChild("HumanoidRootPart") then
  56.             local root = character.HumanoidRootPart
  57.             local speed = (root.Velocity * Vector3.new(1, 0, 1)).magnitude -- Ignore Y velocity
  58.             textLabel.Text = math.floor(speed) .. " Studs/Sec"
  59.         end
  60.     end)
  61.  
  62.     -- Color fading effect on the GUI (Cosmetic/Decor)
  63.     task.spawn(function()
  64.         while screenGui.Parent do
  65.             for i = 35, 0, -1 do -- Fades from winter black to pure black
  66.                 frame.BackgroundColor3 = Color3.fromRGB(i, i, i)
  67.                 task.wait(0.05)
  68.             end
  69.             for i = 0, 35 do -- Fades back
  70.                 frame.BackgroundColor3 = Color3.fromRGB(i, i, i)
  71.                 task.wait(0.05)
  72.             end
  73.         end
  74.     end)
  75. end
  76.  
  77. -- Makes sure GUI doesn't disappear after respawn
  78. player.CharacterAdded:Connect(function()
  79.     task.wait(1) -- Short delay to allow character to fully load
  80.     createSpeedNotifier()
  81. end)
  82.  
  83. createSpeedNotifier()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement