Advertisement
C-H-4-0-S

Heheugdhdhscs

Sep 12th, 2024 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.10 KB | None | 0 0
  1. -- // Constants \\ --
  2. -- [ Services ] --
  3. local Services = setmetatable({}, {__index = function(Self, Index)
  4. local NewService = game.GetService(game, Index)
  5. if NewService then
  6. Self[Index] = NewService
  7. end
  8. return NewService
  9. end})
  10.  
  11. -- [ LocalPlayer ] --
  12. local LocalPlayer = Services.Players.LocalPlayer
  13.  
  14. -- // Functions \\ --
  15. local function PlayerAdded(Player)
  16. local Detected = false
  17. local Character;
  18. local PrimaryPart;
  19.  
  20. local function CharacterAdded(NewCharacter)
  21. Character = NewCharacter
  22. repeat
  23. wait()
  24. PrimaryPart = NewCharacter:FindFirstChild("HumanoidRootPart")
  25. until PrimaryPart
  26. Detected = false
  27. end
  28.  
  29. CharacterAdded(Player.Character or Player.CharacterAdded:Wait())
  30. Player.CharacterAdded:Connect(CharacterAdded)
  31. Services.RunService.Heartbeat:Connect(function()
  32. if (Character and Character:IsDescendantOf(workspace)) and (PrimaryPart and PrimaryPart:IsDescendantOf(Character)) then
  33. if PrimaryPart.AssemblyAngularVelocity.Magnitude > 50 or PrimaryPart.AssemblyLinearVelocity.Magnitude > 100 then
  34. if Detected == false then
  35. game.StarterGui:SetCore("ChatMakeSystemMessage", {
  36. Text = "Fling Exploit detected, Player: " .. tostring(Player);
  37. Color = Color3.fromRGB(255, 200, 0);
  38. })
  39. end
  40. Detected = true
  41. for i,v in ipairs(Character:GetDescendants()) do
  42. if v:IsA("BasePart") then
  43. v.CanCollide = false
  44. v.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
  45. v.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
  46. v.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0)
  47. end
  48. end
  49. PrimaryPart.CanCollide = false
  50. PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
  51. PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
  52. PrimaryPart.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0)
  53. end
  54. end
  55. end)
  56. end
  57.  
  58. _G.AntiFlingConfig = {
  59. -- this will remove your rotational velocity every frame
  60. disable_rotation = true;
  61.  
  62. -- this slows you down if you're moving too fast, works well but can give you a low gravity effect
  63. limit_velocity = true;
  64. limit_velocity_sensitivity = 150; -- how fast you have to be moving before you get slowed down
  65. limit_velocity_slow = 0; -- the amount of velocity you keep; a lower number increases how much you slow down by
  66.  
  67. -- stops you from ragdolling or falling over and losing control
  68. anti_ragdoll = true;
  69.  
  70. -- completely freezes you if someone gets too close to you
  71. anchor = false;
  72. smart_anchor = true; -- only anchors if someone is considered flinging, this likely won't detect many flings
  73. anchor_dist = 30; -- how close someone has to be to trigger anchor
  74.  
  75. -- teleport away if someone gets too close
  76. teleport = false;
  77. smart_teleport = true; -- only teleports if someone is considered flinging, this likely won't detect many flings
  78. teleport_dist = 30; -- how close someone has to be to teleport you
  79. }
  80. -- run _G.disable() to disable the script completely
  81. end
  82. end
  83. end)
  84. end
  85.  
  86. local function isPartRotatingTooFast(part)
  87. if part and part:IsA("BasePart") then
  88. local lastRotation = part.Rotation
  89. wait(0.1) -- Wait a short time to get a second rotation value for comparison
  90. local currentRotation = part.Rotation
  91. local rotationChange = (currentRotation - lastRotation).Magnitude
  92. return rotationChange > rotationThreshold
  93. end
  94. return false
  95. end
  96.  
  97. local function isPartInLocalPlayerCharacter(part)
  98. local localPlayer = game.Players.LocalPlayer
  99. if localPlayer and localPlayer.Character then
  100. return part:IsDescendantOf(localPlayer.Character)
  101. end
  102. return false
  103. end
  104.  
  105. local function createSelectionBox(target)
  106. local outline = Instance.new("SelectionBox")
  107. outline.Name = "RedOutline"
  108. outline.Color3 = outlineColor.Color
  109. outline.Adornee = target
  110. outline.Parent = target
  111. return outline
  112. end
  113. ]]
  114.  
  115. local G = {}
  116. local C = nil
  117. local function Collide(plr)
  118. if plr and plr.Character and plr ~= game.Players.LocalPlayer then
  119. for i,v in pairs (plr.Character:GetDescendants()) do
  120. if v:IsA"BasePart" and v.CanCollide == true then
  121. v.CanCollide = false
  122. v.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
  123. v.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
  124. v.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0)
  125. end
  126. end
  127. end
  128. end
  129.  
  130. local Players = Game:GetService"Players"
  131. local plr = Players.LocalPlayer
  132.  
  133. local function Enable()
  134. for i,v in pairs (Players:GetPlayers()) do
  135. Collide(v)
  136. end
  137. end
  138.  
  139. function G:Enable()
  140. C = game:GetService"RunService".RenderStepped: Connect (Enable)
  141. end
  142. function G:Disable()
  143. C: Disconnect ()
  144. for i,v in pairs(game.Players:GetPlayers()) do
  145. if v ~= plr then
  146. for h,b in pairs(v.Character:GetDescendants()) do
  147. if b:IsA"BasePart" and b.CanCollide == false then
  148. b.CanCollide = true
  149. end
  150. end
  151. end
  152. end
  153. end
  154.  
  155. G:Enable()
  156. return G
  157. end
  158. end
  159. end)
  160. end
  161. -- // Event Listeners \\ --
  162. for i,v in ipairs(Services.Players:GetPlayers()) do if v ~= LocalPlayer then PlayerAdded(v) end end Services.Players.PlayerAdded:Connect(PlayerAdded) local LastPosition = nil Services.RunService.Heartbeat:Connect(function() pcall(function() local PrimaryPart = LocalPlayer.Character.PrimaryPart if PrimaryPart.AssemblyLinearVelocity.Magnitude > 250 or PrimaryPart.AssemblyAngularVelocity.Magnitude > 250 then PrimaryPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0) PrimaryPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0) PrimaryPart.CFrame = LastPosition game.StarterGui:SetCore("ChatMakeSystemMessage", { Text = "You were flung. Neutralizing velocity."; Color = Color3.fromRGB(255, 0, 0); }) elseif PrimaryPart.AssemblyLinearVelocity.Magnitude < 50 or PrimaryPart.AssemblyAngularVelocity.Magnitude > 50 then LastPosition = PrimaryPart.CFrame end end) end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement