local j=CameraShaker.new(Enum.RenderPriority.Camera.Value,function(j)camera.CFrame=camera.CFrame*j end)j:Start()local Z={}function Z.ShakeOnce()if not tool:GetAttribute("\067\097\109\101\114\097\083\104\097\107\101")then return end j:ShakeOnce(5,20,0,1.5,Vector3.new(.5,.5,.5),Vector3.new())end function Z.ShakeSustain()if not tool:GetAttribute("\067\097\109\101\114\097\083\104\097\107\101")then return end j:ShakeSustain(CameraShaker.Presets.Earthquake)end function Z.StopSustained()if not tool:GetAttribute("\067\097\109\101\114\097\083\104\097\107\101")then return end j:StopSustained(1)end return Z
-- initialize camera shaker object
local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCf)
	camera.CFrame = camera.CFrame * shakeCf
end)
camShake:Start()

local CameraShake = {}

function CameraShake.ShakeOnce()
	if not tool:GetAttribute("CameraShake") then
		return
	end
	-- CameraShaker:ShakeOnce(magnitude, roughness [, fadeInTime, fadeOutTime, posInfluence, rotInfluence])
	camShake:ShakeOnce(5, 20, 0, 1.5, Vector3.new(0.5, 0.5, 0.5), Vector3.new())
end

function CameraShake.ShakeSustain()
	if not tool:GetAttribute("CameraShake") then
		return
	end
	camShake:ShakeSustain(CameraShaker.Presets.Earthquake)
end

function CameraShake.StopSustained()
	if not tool:GetAttribute("CameraShake") then
		return
	end
	camShake:StopSustained(1)
end

return CameraShake
