Fall Damage script

Because character has set the network owner to player, if player character teleport locally then everyone can see it; if you change health, everyone can see that your health has changed.

1 Like

Weird, I was told health was only set seever side, reason being that the health regen is the only server script for players, while everything else is local since network replication.

1 Like

Remember, setting part network owner to play allow player to change the property and replicate it to server. Set network nil mean server will own the part. set it to no argument given mean reset to default.

1 Like

If you want to prevent exploit then use 1 script to handle all player character.

1 Like

Player always has control on character, to make movement seamless, dont want to have no control over yourself.

1 Like

I prefer fall damage scripts that determine the amount of fall damage you take based on your vertical velocity rather than how high you fell from.

1 Like

Hello, I’m back from vacation and I just made a simple fall damage script using AssemblyLinearVelocity.

I made a kit too.

And here is the script:

local isFalling = false
local damageThatWillBeGiven = 0

function damageGiver()
	while wait() do
		if isFalling == true then
			if HumanoidRootPart.AssemblyLinearVelocity.Y < -70 and damageThatWillBeGiven <= 15 then
				damageThatWillBeGiven = 15
			end
			if HumanoidRootPart.AssemblyLinearVelocity.Y < -100 and damageThatWillBeGiven <= 30 then
				damageThatWillBeGiven = 30
			end
			if HumanoidRootPart.AssemblyLinearVelocity.Y < -140 and damageThatWillBeGiven <= 50 then
				damageThatWillBeGiven = 50
			end
			if HumanoidRootPart.AssemblyLinearVelocity.Y < -160 and damageThatWillBeGiven <= 75 then
				damageThatWillBeGiven = 75
			end
			if HumanoidRootPart.AssemblyLinearVelocity.Y < -170 and damageThatWillBeGiven <= 100 then
				damageThatWillBeGiven = 100
			end
		end
	end
end

coroutine.wrap(damageGiver)()

while true do
	repeat wait() until HumanoidRootPart.AssemblyLinearVelocity.Y < 0
	if isFalling == false then
		print("player is falling")
		isFalling = true
	end
	repeat wait() until HumanoidRootPart.AssemblyLinearVelocity.Y >= 0
	isFalling = false
	script.Parent.Humanoid.Health -= damageThatWillBeGiven
	print("damage: " .. damageThatWillBeGiven)
	damageThatWillBeGiven = 0
end
1 Like

This is good, but you are calculating it on a local script. Exploiters are gonna remove their fall damage completely.

1 Like

These lines of code can be in a local script and a server-sided script.

2 Likes

I’m not sure, but a server script might not be 100% safe as well since it’s in the player character. I think I heard somewhere that anything inside the character can be deleted. I’m not sure about this, but maybe you should search about it.

1 Like

I have modify the topic, it isn’t cheatable now ! :+1:

Hey I was wondering if you want the fall damage but with ragdoll ?

  • YES !!!
  • no …

0 voters

2 Likes

I notice there was some error into my script so I’ve update it !

2 Likes