Guest User

Roblox speed script

a guest
May 26th, 2025
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | Help | 0 0
  1. local Players = game:GetService("Players")
  2. local CHECK_INTERVAL = 2
  3. local MAX_DISTANCE_PER_5S = 100
  4.  
  5. local function monitorPlayer(player)
  6.     player.CharacterAdded:Connect(function(character)
  7.         local hrp = character:WaitForChild("HumanoidRootPart")
  8.         local positions = {}
  9.  
  10.         while character and hrp and hrp.Parent do
  11.             table.insert(positions, {
  12.                 time = tick(),
  13.                 position = hrp.Position
  14.             })
  15.  
  16.             for i = #positions, 1, -1 do
  17.                 if tick() - positions[i].time > 5 then
  18.                     table.remove(positions, i)
  19.                 end
  20.             end
  21.  
  22.             if #positions >= 2 then
  23.                 local first = positions[1].position
  24.                 local last = positions[#positions].position
  25.                 local distance = (last - first).Magnitude
  26.  
  27.                 if distance > MAX_DISTANCE_PER_5S then
  28.                     warn(player.Name .. " is moving too fast! Distance: " .. math.floor(distance))
  29.                     -- player:Kick("Speed hack detected.")
  30.                 end
  31.             end
  32.  
  33.             wait(CHECK_INTERVAL)
  34.         end
  35.     end)
  36. end
  37.  
  38. Players.PlayerAdded:Connect(monitorPlayer)
  39.  
Tags: #roblox
Advertisement
Add Comment
Please, Sign In to add comment