local u=Spring.spring.new()u.s=16 local c=Spring.spring.new(0)c.s=4 c.d=1 local I=Spring.spring.new(0)I.s=6 I.d=1 I.t=1 local F=Spring.spring.new(Vector3.new())F.s=20 F.d=.75 local S=Spring.spring.new(Vector3.new())S.s=15 S.d=1 local Q={"\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 l={"\082\117\110\110\105\110\103"}local W=0 local m=0 local s=0 local w=Humanoid.Health local K=false local G=false for u,c in pairs(Q)do Humanoid[c]:Connect(function()active=false end)end for u,c in pairs(l)do Humanoid[c]:Connect(function(u)active=u>1 end)end local function A(u)local c=(CFrame.new()):VectorToObjectSpace(u)F:Accelerate(Vector3.new(c.Z,0,-c.X)*.25)Thread:Wait(.03)F:Accelerate(Vector3.new(-c.Z,0,0)*.25)end local function M(u)if w>u and w-u>=5 then if Humanoid.Health~=Humanoid.MaxHealth then local c=w-u Thread:Spawn(function()local u=Vector3.new(0,0,0)if Humanoid:FindFirstChild("\099\114\101\097\116\111\114")then local c=Humanoid.creator local I=c.Value.Character local F=I:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")local S=I:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if I and(S and(F and F.Health>0))then u=(Camera.CFrame.p-S.Position).Unit else u=(Camera.CFrame.p-HumanoidRootPart.Position).Unit end else u=(Camera.CFrame.p-HumanoidRootPart.Position).Unit end A((-c/12+4.1666666666667)*u)end)end end w=u end Humanoid.FreeFalling:Connect(function(u)K=u if K and not G then G=true local u,c=0,math.huge while K do local I=HumanoidRootPart.Position.Y if I>u then u=I end if I<c then c=I end Thread:Wait()end local I=u-c local F=I-GeneralSettings.LowestFallHeight if F>0 then S:Accelerate(Vector3.new(0,0,math.random(-F,F)/5))end G=false end end)RunService.RenderStepped:Connect(function(Q)if Character and(HumanoidRootPart and Humanoid)then local l=(CFrame.new()).VectorToObjectSpace(HumanoidRootPart.CFrame,HumanoidRootPart.Velocity)u.t=(active and Humanoid.Health>0)and(Vector3.new(1,0,1)*l).Magnitude or 0 W=u.p m=m+Q*u.p s=s+Q*I.p if GeneralSettings.FpsCam then local u=CFrame.new()u=Camera.CoordinateFrame local I=s local Q,l=.5*W,(((m*6.28318)/4)*3)/4 local w=c.p local K=Math.FromAxisAngle((Q*math.cos(l+2))/2048,(Q*math.cos(l/2))/2048,(Q*math.cos(l/2+2))/4096)*Math.FromAxisAngle((w*math.cos(2*I+2))/2048,(w*math.cos((2*I)/2))/2048,(w*math.cos((2*I)/2-2))/4096)local G=Math.FromAxisAngle(F.p)local A=Math.FromAxisAngle(S.p)if GeneralSettings.CamBobble then u=u*K end if GeneralSettings.CamHurt then u=u*G end if GeneralSettings.CamImpact then u=u*A end Camera.CoordinateFrame=u end end end)Humanoid.HealthChanged:Connect(M)Humanoid.Died:Connect(function()M(20)end)M(Humanoid.Health)

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)
