local x=Spring.spring.new()x.s=16 local t=Spring.spring.new(0)t.s=4 t.d=1 local Z=Spring.spring.new(0)Z.s=6 Z.d=1 Z.t=1 local o=Spring.spring.new(Vector3.new())o.s=20 o.d=.75 local b=Spring.spring.new(Vector3.new())b.s=15 b.d=1 local V={"\074\117\109\112\105\110\103";"\080\108\097\116\102\111\114\109\083\116\097\110\100\105\110\103","\082\097\103\100\111\108\108","\083\101\097\116\101\100";"\070\097\108\108\105\110\103\068\111\119\110","\070\114\101\101\070\097\108\108\105\110\103";"\071\101\116\116\105\110\103\085\112","\083\119\105\109\109\105\110\103","\067\108\105\109\098\105\110\103"}local y={"\082\117\110\110\105\110\103"}local j=0 local v=0 local U=0 local L=Humanoid.Health local z=false local c=false for x,t in pairs(V)do Humanoid[t]:Connect(function()active=false end)end for x,t in pairs(y)do Humanoid[t]:Connect(function(x)active=x>1 end)end local function p(x)local t=(CFrame.new()):VectorToObjectSpace(x)o:Accelerate(Vector3.new(t.Z,0,-t.X)*.25)Thread:Wait(.03)o:Accelerate(Vector3.new(-t.Z,0,0)*.25)end local function e(x)if L>x and L-x>=5 then if Humanoid.Health~=Humanoid.MaxHealth then local t=L-x Thread:Spawn(function()local x=Vector3.new(0,0,0)if Humanoid:FindFirstChild("\099\114\101\097\116\111\114")then local t=Humanoid.creator local Z=t.Value.Character local o=Z:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")local b=Z:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if Z and(b and(o and o.Health>0))then x=(Camera.CFrame.p-b.Position).Unit else x=(Camera.CFrame.p-HumanoidRootPart.Position).Unit end else x=(Camera.CFrame.p-HumanoidRootPart.Position).Unit end p((-t/12+4.1666666666667)*x)end)end end L=x end Humanoid.FreeFalling:Connect(function(x)z=x if z and not c then c=true local x,t=0,math.huge while z do local Z=HumanoidRootPart.Position.Y if Z>x then x=Z end if Z<t then t=Z end Thread:Wait()end local Z=x-t local o=Z-GeneralSettings.LowestFallHeight if o>0 then b:Accelerate(Vector3.new(0,0,math.random(-o,o)/5))end c=false end end)RunService.RenderStepped:Connect(function(V)if Character and(HumanoidRootPart and Humanoid)then local y=(CFrame.new()).VectorToObjectSpace(HumanoidRootPart.CFrame,HumanoidRootPart.Velocity)x.t=(active and Humanoid.Health>0)and(Vector3.new(1,0,1)*y).Magnitude or 0 j=x.p v=v+V*x.p U=U+V*Z.p if GeneralSettings.FpsCam then local x=CFrame.new()x=Camera.CoordinateFrame local Z=U local V,y=.5*j,(((v*6.28318)/4)*3)/4 local L=t.p local z=Math.FromAxisAngle((V*math.cos(y+2))/2048,(V*math.cos(y/2))/2048,(V*math.cos(y/2+2))/4096)*Math.FromAxisAngle((L*math.cos(2*Z+2))/2048,(L*math.cos((2*Z)/2))/2048,(L*math.cos((2*Z)/2-2))/4096)local c=Math.FromAxisAngle(o.p)local p=Math.FromAxisAngle(b.p)if GeneralSettings.CamBobble then x=x*z end if GeneralSettings.CamHurt then x=x*c end if GeneralSettings.CamImpact then x=x*p end Camera.CoordinateFrame=x end end end)Humanoid.HealthChanged:Connect(e)Humanoid.Died:Connect(function()e(20)end)e(Humanoid.Health)
--legends:
--[s]: speed
--[d]: damper
--[t]: target
--[p]: position
--[v]: velocity
local SpeedSpring = Spring.spring.new()
SpeedSpring.s = 16
local SwaySpring = Spring.spring.new(0)
SwaySpring.s = 4
SwaySpring.d = 1
local SwaySpeed = Spring.spring.new(0)
SwaySpeed.s = 6
SwaySpeed.d = 1
SwaySpeed.t = 1
local DamageSpring = Spring.spring.new(Vector3.new())
DamageSpring.s = 20
DamageSpring.d = 0.75
local ImpactSpring = Spring.spring.new(Vector3.new())
ImpactSpring.s = 15
ImpactSpring.d = 1

local OffStates = {
	"Jumping",
	"PlatformStanding",
	"Ragdoll",
	"Seated",
	"FallingDown",
	"FreeFalling",
	"GettingUp",
	"Swimming",
	"Climbing",
}
local OnStates = { "Running" }

local speed = 0
local distance = 0
local swayT = 0
local lastHealth = Humanoid.Health
local isFalling = false
local debounce = false

for _, state in pairs(OffStates) do
	Humanoid[state]:Connect(function()
		active = false
	end)
end

for _, state in pairs(OnStates) do
	Humanoid[state]:Connect(function(speed)
		active = (speed > 1)
	end)
end

local function GetHit(d)
	local l = CFrame.new():VectorToObjectSpace(d)
	DamageSpring:Accelerate(Vector3.new(l.Z, 0, -l.X) * 0.25)
	Thread:Wait(0.03)
	DamageSpring:Accelerate(Vector3.new(-l.Z, 0, 0) * 0.25)
end

local function HealthChanged(health)
	if lastHealth > health and lastHealth - health >= 5 then
		if Humanoid.Health ~= Humanoid.MaxHealth then
			local damageDealt = lastHealth - health
			Thread:Spawn(function()
				local dir = Vector3.new(0, 0, 0)
				if Humanoid:FindFirstChild("creator") then
					local killer = Humanoid.creator
					local killerChar = killer.Value.Character
					local killerHum = killerChar:FindFirstChildOfClass("Humanoid")
					local killerHRP = killerChar:FindFirstChild("HumanoidRootPart")
					if killerChar and killerHRP and killerHum and killerHum.Health > 0 then
						dir = (Camera.CFrame.p - killerHRP.Position).Unit
					else
						dir = (Camera.CFrame.p - HumanoidRootPart.Position).Unit
					end
				else
					dir = (Camera.CFrame.p - HumanoidRootPart.Position).Unit
				end
				GetHit((-damageDealt / 12 + 4.166666666666667) * dir)
			end)
		end
	end
	lastHealth = health
end

Humanoid.FreeFalling:Connect(function(falling)
	isFalling = falling
	if isFalling and not debounce then
		debounce = true
		local maxHeight, lowHeight = 0, math.huge
		while isFalling do
			local height = HumanoidRootPart.Position.Y
			if height > maxHeight then
				maxHeight = height
			end
			if height < lowHeight then
				lowHeight = height
			end
			Thread:Wait()
		end
		local fallHeight = maxHeight - lowHeight
		local impactHeight = fallHeight - GeneralSettings.LowestFallHeight
		if impactHeight > 0 then
			--local damage = impactHeight * (humanoid.MaxHealth / GeneralSettings.MaxFallHeight)
			--humanoid:TakeDamage(damage)
			ImpactSpring:Accelerate(Vector3.new(0, 0, math.random(-impactHeight, impactHeight) / 5))
		end
		debounce = false
	end
end)

RunService.RenderStepped:Connect(function(dt)
	if Character and HumanoidRootPart and Humanoid then
		local RelativeVelocity = CFrame.new().VectorToObjectSpace(HumanoidRootPart.CFrame, HumanoidRootPart.Velocity)
		SpeedSpring.t = (active and Humanoid.Health > 0) and (Vector3.new(1, 0, 1) * RelativeVelocity).Magnitude or 0
		speed = SpeedSpring.p
		distance = distance + dt * SpeedSpring.p
		swayT = swayT + dt * SwaySpeed.p
		if GeneralSettings.FpsCam then
			local CF = CFrame.new()
			CF = Camera.CoordinateFrame
			local T = swayT
			local S, D = 0.5 * speed, distance * 6.28318 / 4 * 3 / 4
			local SS = SwaySpring.p
			local BobAngles = Math.FromAxisAngle(
				S * math.cos(D + 2) / 2048,
				S * math.cos(D / 2) / 2048,
				S * math.cos(D / 2 + 2) / 4096
			) * Math.FromAxisAngle(
				SS * math.cos(2 * T + 2) / 2048,
				SS * math.cos(2 * T / 2) / 2048,
				SS * math.cos(2 * T / 2 - 2) / 4096
			)
			local DamageAngles = Math.FromAxisAngle(DamageSpring.p)
			local ImpactAngles = Math.FromAxisAngle(ImpactSpring.p)
			if GeneralSettings.CamBobble then
				CF = CF * BobAngles
			end
			if GeneralSettings.CamHurt then
				CF = CF * DamageAngles
			end
			if GeneralSettings.CamImpact then
				CF = CF * ImpactAngles
			end
			Camera.CoordinateFrame = CF
		end
	end
end)

Humanoid.HealthChanged:Connect(HealthChanged)

Humanoid.Died:Connect(function()
	HealthChanged(20)
end)

HealthChanged(Humanoid.Health)
