Riky47-Haxer

Driving-Simulator-Anti-Cheat

Jun 9th, 2020
9,245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. --[[
  2.     Riky47#3355's Anti-Cheat - v1.0
  3.     -Driving Simulator
  4. ]]
  5.  
  6. --[[
  7. local title = " -Riky47#3355's Anti-Cheat"
  8. local reason1 = "Auto-Farm or Ista-Win exploit!" .. title
  9. local reason2 = "Teleporting exploit!" .. title
  10.  
  11. local maxDistance = 500 --Max magnitude distance in a Delay
  12. local Delay = 1 --Delay ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  13. ]]
  14.  
  15. local oneTime = true --Run only 1 time in the while loop
  16.  
  17. --[[
  18. local function kick(reason)
  19.     game:GetService("Players").LocalPlayer:Kick(reason)
  20. end
  21. ]]
  22.  
  23. local function findCar()
  24.     for _,v in pairs(game.Workspace['$cars']:GetChildren()) do
  25.         if v:FindFirstChild("State") then
  26.             if v.State.Driver.Value == game.Players.LocalPlayer then
  27.                 return v
  28.             end
  29.         end
  30.     end
  31. end
  32.  
  33. while wait() do
  34.     local car = nil
  35.     local car = findCar() --Define Player Car
  36.    
  37.     if car ~= nil then
  38.         -- Check for BodyPosition part who move the car in Auto-Farm or Ista-Win Exploits
  39.         for i,v in pairs(car.Body:FindFirstChild("PrimaryBody"):GetChildren()) do
  40.             if v:IsA('BodyPosition') then
  41.                 kick(reason1)
  42.             end
  43.         end
  44.        
  45.         -- Check for car magnitude
  46.         local pos = car.Body:FindFirstChild("PrimaryBody").Position
  47.         wait(Delay)
  48.         if (pos - car.Body:FindFirstChild("PrimaryBody").Position).Magnitude > maxDistance then
  49.             kick(reason2)
  50.         end
  51.     end    
  52.    
  53.     if oneTime then
  54.         oneTime = false
  55.         print("Running Riky47#3355's Anti-Cheat")
  56.     end
  57. end
Advertisement
Add Comment
Please, Sign In to add comment