Advertisement
_Thanh_Thy_Cute_

ROBLOX PREVENT CHARACTER FROM TRIPPING SCRIPT

Aug 5th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. --I took this snippet from a big project of mine so don’t mind the large amount of variables that I’ve used.
  2. local Players = game:GetService("Players")
  3. local NetworkClient = game:GetService("NetworkClient");
  4.  
  5. local FindFirstChildWhichIsA; FindFirstChildWhichIsA = game["FindFirstChildWhichIsA"]
  6. local NetworkReplicator = FindFirstChildWhichIsA(NetworkClient, "NetworkReplicator");
  7. local WaitForChildWhichIsA; WaitForChildWhichIsA = function(self, string: string)
  8. local success, response = pcall(FindFirstChildWhichIsA, self, string);
  9. if not success or not response then
  10. repeat
  11. wait()
  12. success, response = pcall(FindFirstChildWhichIsA, self, string)
  13. until success and response and typeof(response) == "Instance"
  14. end
  15. return response;
  16. end
  17.  
  18. local LocalPlayer = NetworkReplicator:GetPlayer()
  19. local OnCharacterAdded; OnCharacterAdded = function(Character)
  20. local Humanoid: Humanoid = WaitForChildWhichIsA(Character, "Humanoid");
  21. local RootPart: BasePart = Humanoid.RootPart;
  22.  
  23. Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false);
  24. end;
  25. coroutine.wrap(pcall)(function()
  26. OnCharacterAdded(LocalPlayer.Character)
  27. end)
  28. LocalPlayer.CharacterAdded:Connect(OnCharacterAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement