Cronaldo_960

Script Roblox studio antifling

Sep 13th, 2025
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | Source Code | 0 0
  1. -- AntiFling Script (English Version)
  2. -- Place this Script inside ServerScriptService
  3.  
  4. local Players = game:GetService("Players")
  5.  
  6. -- Configuration limits
  7. local MAX_LINEAR_VELOCITY = 100 -- maximum normal speed
  8. local MAX_ROTATION_VELOCITY = 100 -- maximum normal rotation
  9. local CHECK_INTERVAL = 1 -- seconds between checks
  10. local MAX_VIOLATIONS = 3 -- kick after how many detections
  11. local VIOLATION_RESET_TIME = 30 -- reset violation counter after 30 seconds
  12.  
  13. local violations = {} -- [userId] = {count, lastCheck}
  14.  
  15. local function protectCharacter(player, character)
  16. task.wait(1) -- wait for character to load
  17. local humanoidRoot = character:FindFirstChild("HumanoidRootPart")
  18. if not humanoidRoot then return end
  19.  
  20. while character.Parent do
  21. local vel = humanoidRoot.AssemblyLinearVelocity.Magnitude
  22. local rot = humanoidRoot.AssemblyAngularVelocity.Magnitude
  23.  
  24. if vel > MAX_LINEAR_VELOCITY or rot > MAX_ROTATION_VELOCITY then
  25. -- Reset abnormal velocity
  26. humanoidRoot.AssemblyLinearVelocity = Vector3.new(0,0,0)
  27. humanoidRoot.AssemblyAngularVelocity = Vector3.new(0,0,0)
  28.  
  29. -- Record violation
  30. local userId = player.UserId
  31. local now = tick()
  32. local rec = violations[userId]
  33. if not rec or now - rec.lastCheck > VIOLATION_RESET_TIME then
  34. rec = {count = 0, lastCheck = now}
  35. violations[userId] = rec
  36. end
  37. rec.count = rec.count + 1
  38. rec.lastCheck = now
  39.  
  40. warn(("[AntiFling] %s (%d) suspected of fling! Count=%d"):format(player.Name, userId, rec.count))
  41.  
  42. if rec.count >= MAX_VIOLATIONS then
  43. player:Kick("You have been detected using fling/exploit.")
  44. end
  45. end
  46.  
  47. task.wait(CHECK_INTERVAL)
  48. end
  49. end
  50.  
  51. Players.PlayerAdded:Connect(function(player)
  52. player.CharacterAdded:Connect(function(char)
  53. protectCharacter(player, char)
  54. end)
  55. end)
  56.  
  57. Players.PlayerRemoving:Connect(function(player)
  58. violations[player.UserId] = nil
  59. end)
Advertisement
Add Comment
Please, Sign In to add comment