Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(0, 200, 0, 80)
- textLabel.Position = UDim2.new(0.5, -100, 0.5, -25)
- textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
- textLabel.TextColor3 = Color3.new(1, 1, 1)
- textLabel.TextScaled = true
- textLabel.Parent = screenGui
- local function getInternetSpeed()
- local httpService = game:GetService("HttpService")
- local startTime = tick()
- local data = httpService:UrlEncode("https://www.scriptblox.com")
- local endTime = tick()
- local dataSize = #data
- local timeTaken = endTime - startTime
- local speed = (dataSize / 1024) / timeTaken
- return speed
- end
- local function formatNumber(num)
- if num >= 1000 then
- return string.format("%.2f", num / 1000) .. " KB/s"
- else
- return string.format("%.2f", num) .. " B/s"
- end
- end
- while wait(1) do
- local speed = getInternetSpeed()
- textLabel.Text = formatNumber(speed)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement