local U=require(game.ReplicatedStorage.Modules.CameraShaker)local Z=game.Workspace.CurrentCamera local f={}local Q=U.new(Enum.RenderPriority.Camera.Value,function(U)Z.CFrame=Z.CFrame*U end)Q:Start()local K=300 function f.Initialize()while script.Parent and script.Parent~=nil do wait(math.random(60,120))local f=(Z.CFrame.Position-script.Parent.Position).Magnitude if f<=K then Q:Shake(U.Presets.Earthquake)end script.Parent.Erupt:Play()script.Parent.ParticleEmitter.Enabled=true wait(8)script.Parent.ParticleEmitter.Enabled=false end end return f
--module is tagged "EffectModule"
--client gets all modules with this tag and calls initialize()
local CameraShaker = require(game.ReplicatedStorage.Modules.CameraShaker)
local camera = game.Workspace.CurrentCamera

local module = {}

local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
	camera.CFrame = camera.CFrame * shakeCFrame
end)

camShake:Start()

local minimumDistance = 300

function module.Initialize()
	while script.Parent and script.Parent ~= nil do
		wait(math.random(60, 120))
		local distance = (camera.CFrame.Position - script.Parent.Position).Magnitude
		if distance <= minimumDistance then
			camShake:Shake(CameraShaker.Presets.Earthquake)
		end
		script.Parent.Erupt:Play()
		script.Parent.ParticleEmitter.Enabled = true
		wait(8)
		script.Parent.ParticleEmitter.Enabled = false
	end
end

return module
