-- Function to shake the screen

local function shakeScreen(magnitude, duration)
	local shakeOffset = Vector3.new(
		math.random(-magnitude * 100, magnitude * 100) / 100,
		math.random(-magnitude * 100, magnitude * 100) / 100,
		math.random(-magnitude * 100, magnitude * 100) / 100
	)
	local shakeCFrame = camera.CFrame + shakeOffset
	local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
	local tween = game:GetService("TweenService"):Create(camera, tweenInfo, {CFrame = shakeCFrame})
	tween:Play()
end
