Advertisement
VenoxComeback

Untitled

Mar 8th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. -- Anti-Fall Damage Script
  2. local Player = game.Players.LocalPlayer
  3. local Character = Player.Character or Player.CharacterAdded:Wait()
  4. local Humanoid = Character:WaitForChild("Humanoid")
  5. local MaxFallSpeed = 50 -- The maximum fall speed before fall damage is usually applied (can be adjusted)
  6.  
  7. -- Function to disable fall damage
  8. local function disableFallDamage()
  9. -- Listen to when the humanoid lands on the ground
  10. Humanoid.FreeFalling:Connect(function()
  11. -- Check if the player is falling, then monitor their fall speed
  12. local fallingVelocity = Humanoid.RootPart.Velocity
  13. -- If the player is falling too fast, set their velocity to a safe value
  14. if fallingVelocity.Y < -MaxFallSpeed then
  15. -- Set the velocity to a safe level
  16. Humanoid.RootPart.Velocity = Vector3.new(fallingVelocity.X, -MaxFallSpeed, fallingVelocity.Z)
  17. end
  18. end)
  19.  
  20. -- Prevent fall damage by manually updating humanoid health on landing
  21. Humanoid.Landed:Connect(function()
  22. if Humanoid.Health > 0 then
  23. -- Prevent damage upon landing by restoring full health (or a safe amount)
  24. Humanoid.Health = Humanoid.Health + 0.1 -- Small adjustment to prevent fall damage
  25. end
  26. end)
  27. end
  28.  
  29. -- Ensure fall damage is disabled upon respawn
  30. Player.CharacterAdded:Connect(function(character)
  31. Character = character
  32. Humanoid = character:WaitForChild("Humanoid")
  33. disableFallDamage()
  34. end)
  35.  
  36. -- Call the function to disable fall damage on player spawn
  37. disableFallDamage()
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement