Below is my script:
unit = 0.5 --Seconds
damageperunit = 1
damage = 0
game.Players.PlayerAdded:connect(function(plyr)
plyr.CharacterAdded:connect(function(char)
local h = char:FindFirstChild("Humanoid")
local hrp = char:FindFirstChild("HumanoidRootPart")
while wait(unit) do
if hrp.Velocity.Y < 0 then
damage = damage+damageperunit
else
h:TakeDamage(damage)
damage = 0
end
print(damage, hrp.Velocity.Y) --Print how much damage you will take and how fast you're moving.
end
end)
end)
Thanks to NotsoPenguin, he gave me an Idea with his script.
This works perfectly fine except that when the player hits the ground they take no damage until seconds later because the HumanoidRootPart is still going at 0.0000000001 or something. Another thing is I used this command line:
workspace.Player1.Torso.CFrame = CFrame.new(Vector3.new(workspace.Player1.Torso.Position.X,workspace.Player1.Torso.Position.Y+99999,workspace.Player1.Torso.Position.Z))
It should keep adding more damage points per unit or half second, It only switches between 1 to 0 damage.
Should I fix this script or should I multiply -1.5 to the Velocity?
h:TakeDamage(Velocity*-1.5)

3 comments
Aditionally, the bug with the humanoid root part might be because of roblox's new player animations, i.e. bobbing up and down while he's standing still.
Nope. The bobbing up and down affects the torso. Not the HumanoidRootPart. The new animations has nothing to do with this glitch.
https://scriptinghelpers.org/questions/15283/fall-damage-script-help-please-anyone