Advertisement
rrixh

detekted

Jun 5th, 2024
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3.  
  4. local MaxWalkSpeed = 16
  5. local CheckInterval = 1
  6.  
  7. local function onPlayerAdded(player)
  8.     local character = player.Character or player.CharacterAdded:Wait()
  9.    
  10.     --[[ monitor ws]]
  11.     local humanoid = character:WaitForChild("Humanoid")
  12.     humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
  13.         if humanoid.WalkSpeed > MaxWalkSpeed then
  14.             player:Kick("what the hell is u doing")
  15.         end
  16.     end);
  17.  
  18. local lastpos = character.PrimaryPart.Position;
  19.     RunService.Heartbeat:Connect(function()
  20. local kurrentPos=character.PrimaryPart.Position
  21.    local distanxe = (kurrentPos - lastpos).magnitude
  22.         if distanxe > (MaxWalkSpeed * CheckInterval * 1.5) then
  23.             player:Kick("flying detekted")
  24.         end
  25.         lastpos = kurrentPos
  26.     end)
  27. end;
  28.  
  29. Players.PlayerAdded:Connect(onPlayerAdded)
  30.  
  31. for _, player in pairs(Players:GetPlayers()) do
  32.     onPlayerAdded(player)
  33. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement