How do i make a Shake Camera when BoolValue is enabled or disabled?

How do i make this work so i want shake camera to shake if BoolValue is enabled or disabled
If Disabled, Won’t shake
If Enabled, will shake
(shut up topic is similar to)

1 Like

could anyone help me
???

what⠀⠀⠀⠀

nothing

why was there an empty message

idk

Isn’t camera shake broken now? (Broken because of camera fx, only map shake works)

not original dark sci shake, the working with CurrentCamera lol

Place this in LocalEventScript

local MAP = workspace.Multiplayer:WaitForChild("Map")
local RunService = game:GetService("RunService") -- Gets RunService For Timing
local Camera = workspace.CurrentCamera -- Gets The Camera
local intensity = 0 -- Intensity Of Shake (Script Will Change It)
local rawIntensity = 4 -- The RawIntensity (The Base Intensity which Will make the shake lower in size)

local Sound = Instance.new("Sound", game.Workspace) -- This Sets Up The Sound
Sound.SoundId = "rbxassetid://153274423" -- Adds Sound ID
Sound.Volume = 1 -- Adds Volume

function shake()
   Sound:Play()
   RunService:BindToRenderStep("CamShakeForBool", Enum.RenderPriority.Camera.Value + 1, function()
      Camera.CFrame = Camera.CFrame * CFrame.new( -- Offsets The Camera
        (math.random() - 0.5) * intensity * rawIntensity,
        (math.random() - 0.5) * intensity * rawIntensity,
        (math.random() - 0.5) * intensity * rawIntensity
       )

       intensity = intensity - step -- Lowers The Intensity
       if intensity < 0 then
           intensity = 0
           RunService:UnbindFromRenderStep("CamShakeForBool")
       end
   end)
end

while true do
    local bool = MAP:FindFirstChild("ShakeEnabled")
    if bool and bool.Value then
        Shake()
        repeat 
            RunService.Heartbeat:Wait() -- wait until value is not true
        until not bool.Value
    end
   RunService.Heartbeat:Wait()
end

Note: I wrote this without testing so If it doesn’t work then tell me.

Also, you need a bool value in the map called ShakeEnabled

@Kriscross102RB
Thanks, Added it to Solution list!

doesnt work…

is little errors, you can fix it uh