Advertisement
Guest User

Fling Things and People [ANTI-GRAB]

a guest
Aug 6th, 2022
8,344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.44 KB | None | 1 1
  1. local PS = game:GetService("Players")
  2. local Player = PS.LocalPlayer
  3. local Character = Player.Character or Player.CharacterAdded:Wait()
  4. local RS = game:GetService("ReplicatedStorage")
  5. local CE = RS:WaitForChild("CharacterEvents")
  6. local R = game:GetService("RunService")
  7. local BeingHeld = Player:WaitForChild("IsHeld")
  8. local PlayerScripts = Player:WaitForChild("PlayerScripts")
  9.  
  10. --[[ Remotes ]]
  11. local StruggleEvent = CE:WaitForChild("Struggle")
  12.  
  13. --[[ Anti-Explosion ]]
  14. workspace.DescendantAdded:Connect(function(v)
  15. if v:IsA("Explosion") then
  16. v.BlastPressure = 0
  17. end
  18. end)
  19.  
  20. --[[ Anti-grab ]]
  21.  
  22. BeingHeld.Changed:Connect(function(C)
  23.     if C == true then
  24.         local char = Player.Character
  25.  
  26.         if BeingHeld.Value == true then
  27.             local Event;
  28.             Event = R.RenderStepped:Connect(function()
  29.                 if BeingHeld.Value == true then
  30.                     char["HumanoidRootPart"].AssemblyLinearVelocity = Vector3.new()
  31.                     StruggleEvent:FireServer(Player)
  32.                 elseif BeingHeld.Value == false then
  33.                     Event:Disconnect()
  34.                 end
  35.             end)
  36.         end
  37.     end
  38. end)
  39.  
  40. Player.CharacterAdded:Connect(function(char)
  41.     char:FindFirstChildOfClass("Humanoid").Changed:Connect(function(C)
  42.         if C == "Sit" and Humanoid.Sit == true then
  43.             if Humanoid.SeatPart ~= nil and tostring(Humanoid.SeatPart.Parent) == "CreatureBlobman" then
  44.             elseif Humanoid.SeatPart == nil then
  45.             Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
  46.             Humanoid.Sit = false
  47.             end
  48.         end
  49.     end)
  50. end)
  51.  
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement