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 :
local HeightRequired = 10
local DamageScale = 2.5
game.Players.PlayerAdded: Connect(function(Player)
Player.CharacterAdded: Connect(function(Character)
local HumanoidRootPart = Character:WaitForChild('HumanoidRootPart')
local Humanoid = Character:WaitForChild('Humanoid')
local StartJump = nil
Humanoid.FreeFalling:Connect(function(Active)
if Active then
StartJump = HumanoidRootPart.Position.Y
else
local JumpHeight = StartJump - HumanoidRootPart.Position.Y
if JumpHeight > HeightRequired then
Humanoid:TakeDamage((JumpHeight - HeightRequired)*DamageScale)
end
end
end)
end)
end)
so how would I make it so you can negate the fall damage from happening when a certain part is touched?

2 comments
works fine, but using "not" doesn't work, I simply changed it from that to using ~= instead of an ==
Oops, I'll correct the answer