YT_PatricioTGN

Untitled

Feb 1st, 2023
1,873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. --Script 1 (para ver quienes flingean y que no te flingueen):
  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)
Add Comment
Please, Sign In to add comment