Negating a fall damage script when you touch a certain part?
I have a fall damage script, and I want it to not do damage if you hit a part that's inside a folder.
I do have a way to negate it already, but it delays the damage from happening for like 3 seconds, and I think that it looks sloppy to have it delayed that much.
my script right now is as follows :
01 | local HeightRequired = 10 |
02 | local DamageScale = 2.5 |
03 | game.Players.PlayerAdded: Connect( function (Player) |
04 | Player.CharacterAdded: Connect( function (Character) |
05 | local HumanoidRootPart = Character:WaitForChild( 'HumanoidRootPart' ) |
06 | local Humanoid = Character:WaitForChild( 'Humanoid' ) |
10 | Humanoid.FreeFalling:Connect( function (Active) |
12 | StartJump = HumanoidRootPart.Position.Y |
14 | local JumpHeight = StartJump - HumanoidRootPart.Position.Y |
16 | if JumpHeight > HeightRequired then |
19 | Humanoid:TakeDamage((JumpHeight - HeightRequired)*DamageScale) |
so how would I make it so you can negate the fall damage from happening when a certain part is touched?