Advertisement
C-H-4-0-S

Anti fling

Mar 29th, 2024 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. loadstring(game:HttpGet(('https://pastebin.com/raw/GxdesRQx'),true))()
  2.  
  3. -- // Constants \\ --
  4. -- [ Services ] --
  5. local Services = setmetatable({}, {__index = function(Self, Index)
  6. local NewService = game.GetService(game, Index)
  7. if NewService then
  8. Self[Index] = NewService
  9. end
  10. return NewService
  11. end})
  12.  
  13. -- [ LocalPlayer ] --
  14. local LocalPlayer = Services.Players.LocalPlayer
  15.  
  16. -- // Functions \\ --
  17. local function PlayerAdded(Player)
  18. local Detected = false
  19. local Character;
  20. local PrimaryPart;
  21.  
  22. local function CharacterAdded(NewCharacter)
  23. Character = NewCharacter
  24. repeat
  25. wait()
  26. PrimaryPart = NewCharacter:FindFirstChild("HumanoidRootPart")
  27. until PrimaryPart
  28. Detected = false
  29. end
  30.  
  31. CharacterAdded(Player.Character or Player.CharacterAdded:Wait())
  32. Player.CharacterAdded:Connect(CharacterAdded)
  33. Services.RunService.Heartbeat:Connect(function()
  34. if (Character and Character:IsDescendantOf(workspace)) and (PrimaryPart and PrimaryPart:IsDescendantOf(Character)) then
  35. if PrimaryPart.AssemblyAngularVelocity.Magnitude > 50 or PrimaryPart.AssemblyLinearVelocity.Magnitude > 100 then
  36. if Detected == false then
  37. game.StarterGui:SetCore("ChatMakeSystemMessage", {
  38. Text = "Fling Exploit detected, Player: " .. tostring(Player);
  39. Color = Color3.fromRGB(255, 200, 0);
  40. })
  41. end
  42. Detected = true
  43. for i,v in ipairs(Character:GetDescendants()) do
  44. if v:IsA("BasePart") then
  45. v.CanCollide = false
  46. v.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
  47. v.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
  48. v.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0)
  49. end
  50. end
  51. PrimaryPart.CanCollide = false
  52. PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
  53. PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
  54. PrimaryPart.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0)
  55. end
  56. end
  57. end)
  58. end
  59.  
  60. -- // Event Listeners \\ --
  61. for i,v in ipairs(Services.Players:GetPlayers()) do
  62. if v ~= LocalPlayer then
  63. PlayerAdded(v)
  64. end
  65. end
  66. Services.Players.PlayerAdded:Connect(PlayerAdded)
  67.  
  68. local LastPosition = nil
  69. Services.RunService.Heartbeat:Connect(function()
  70. pcall(function()
  71. local PrimaryPart = LocalPlayer.Character.PrimaryPart
  72. if PrimaryPart.AssemblyLinearVelocity.Magnitude > 250 or PrimaryPart.AssemblyAngularVelocity.Magnitude > 250 then
  73. PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
  74. PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
  75. PrimaryPart.CFrame = LastPosition
  76.  
  77. game.StarterGui:SetCore("ChatMakeSystemMessage", {
  78. Text = "You were flung. Neutralizing velocity.";
  79. Color = Color3.fromRGB(255, 0, 0);
  80. })
  81. elseif PrimaryPart.AssemblyLinearVelocity.Magnitude < 50 or PrimaryPart.AssemblyAngularVelocity.Magnitude > 50 then
  82. LastPosition = PrimaryPart.CFrame
  83. end
  84. end)
  85. end)
  86.  
  87. _G.AntiFlingConfig = {
  88. -- this will remove your rotational velocity every frame
  89. disable_rotation = true;
  90.  
  91. -- this slows you down if you're moving too fast, works well but can give you a low gravity effect
  92. limit_velocity = true;
  93. limit_velocity_sensitivity = 100; -- how fast you have to be moving before you get slowed down
  94. limit_velocity_slow = 0; -- the amount of velocity you keep; a lower number increases how much you slow down by
  95.  
  96. -- stops you from ragdolling or falling over and losing control
  97. anti_ragdoll = true;
  98.  
  99. -- completely freezes you if someone gets too close to you
  100. anchor = false;
  101. smart_anchor = true; -- only anchors if someone is considered flinging, this likely won't detect many flings
  102. anchor_dist = 30; -- how close someone has to be to trigger anchor
  103.  
  104. -- teleport away if someone gets too close
  105. teleport = false;
  106. smart_teleport = true; -- only teleports if someone is considered flinging, this likely won't detect many flings
  107. teleport_dist = 1; -- how close someone has to be to teleport you
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement