Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Speed Notifier GUI, Updates every 0.25 seconds.
- local player = game.Players.LocalPlayer
- local starterGui = game:GetService("StarterGui")
- local runService = game:GetService("RunService")
- -- Create the GUI
- local function createSpeedNotifier()
- -- Check if GUI already exists and remove it to avoid duplicates
- if player:FindFirstChild("PlayerGui") then
- local existingGui = player.PlayerGui:FindFirstChild("SpeedNotifier")
- if existingGui then
- existingGui:Destroy()
- end
- end
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "SpeedNotifier"
- screenGui.ResetOnSpawn = false -- Prevents GUI from disappearing and changed on respawn
- screenGui.Parent = player:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0.3, 0, 0.1, 0)
- frame.Position = UDim2.new(0.35, 0, 0.05, 0)
- frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35) -- Slightly white but mostly black color
- frame.BorderSizePixel = 2 -- Added outline
- frame.BorderColor3 = Color3.fromRGB(255, 255, 255) -- White outline
- frame.Active = true
- frame.Draggable = true -- Makes the GUI moveable
- frame.Parent = screenGui
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(1, 0, 0.7, 0)
- textLabel.Position = UDim2.new(0, 0, 0, 0)
- textLabel.BackgroundTransparency = 1
- textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- textLabel.TextScaled = false
- textLabel.TextSize = 45 -- Increased text size
- textLabel.Font = Enum.Font.SourceSansBold
- textLabel.Parent = frame
- local subTextLabel = Instance.new("TextLabel")
- subTextLabel.Size = UDim2.new(1, 0, 0.3, 0)
- subTextLabel.Position = UDim2.new(0, 0, 0.6, 0)
- subTextLabel.BackgroundTransparency = 1
- subTextLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
- subTextLabel.TextSize = 20
- subTextLabel.TextScaled = false
- subTextLabel.Font = Enum.Font.SourceSans
- subTextLabel.Text = "[IGNORES VELOCITY.]"
- subTextLabel.Parent = frame
- -- Function to update speed
- runService.RenderStepped:Connect(function()
- local character = player.Character
- if character and character:FindFirstChild("HumanoidRootPart") then
- local root = character.HumanoidRootPart
- local speed = (root.Velocity * Vector3.new(1, 0, 1)).magnitude -- Ignore Y velocity
- textLabel.Text = math.floor(speed) .. " Studs/Sec"
- end
- end)
- -- Color fading effect on the GUI (Cosmetic/Decor)
- task.spawn(function()
- while screenGui.Parent do
- for i = 35, 0, -1 do -- Fades from winter black to pure black
- frame.BackgroundColor3 = Color3.fromRGB(i, i, i)
- task.wait(0.05)
- end
- for i = 0, 35 do -- Fades back
- frame.BackgroundColor3 = Color3.fromRGB(i, i, i)
- task.wait(0.05)
- end
- end
- end)
- end
- -- Makes sure GUI doesn't disappear after respawn
- player.CharacterAdded:Connect(function()
- task.wait(1) -- Short delay to allow character to fully load
- createSpeedNotifier()
- end)
- createSpeedNotifier()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement