local l=getSetting("\068\097\109\097\103\105\110\103 \104\101\105\103\104\116")or 20 local y=getSetting("\076\101\116\104\097\108 \104\101\105\103\104\116")or 42;(game:GetService("\080\108\097\121\101\114\115")).PlayerAdded:Connect(function(S)S.CharacterAdded:Connect(function(S)local T=S:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local s=S:WaitForChild("\072\117\109\097\110\111\105\100")if s and T then local S wait(3)s.FreeFalling:Connect(function(i)if i then S=T.Position.Y elseif not i and S~=nil then pcall(function()local i=S-T.Position.Y if i>=y then s.Health=0 elseif i>=l then s.Health=s.Health-math.floor(i)end end)end end)end end)end)
-- Variables
local damageHeight = getSetting("Damaging height") or 20 -- The height at which the player will start getting damaged at
local lethalHeight = getSetting("Lethal height") or 42 -- The height at which the player will get killed

game:GetService("Players").PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local root = char:WaitForChild("HumanoidRootPart")
		local humanoid = char:WaitForChild("Humanoid")

		if humanoid and root then
			local headHeight

			wait(3) -- Prevent the player from dying on spawn
			humanoid.FreeFalling:Connect(function(state)
				if state then
					headHeight = root.Position.Y
				elseif not state and headHeight ~= nil then
					pcall(function()
						local fell = headHeight - root.Position.Y

						if fell >= lethalHeight then
							humanoid.Health = 0
						elseif fell >= damageHeight then
							humanoid.Health = humanoid.Health - math.floor(fell)
						end
					end)
				end
			end)
		end
	end)
end)
