So I made a fully functioning camera shake script(local script), and it only seemed to just transport downwards once and then just stop. It didn't go up and down like it's supposed to. What problem is there? Thanks
local c = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
math.randomseed(tick())
plr.ShakeCamera.OnClientEvent:connect(function()
c.CameraType = "Scriptable"
for i = 1,10 do
if plr.Character:FindFirstChild("Torso") then
c.CFrame = c.CFrame + Vector3.new(0,-4,0)
print("down")
end
wait(.1)
if plr.Character:FindFirstChild("Head") then
c.CFrame = c.CFrame + Vector3.new(0,4,0)
print("up")
end
end
c.CameraType = "Custom"
end)

3 comments
You need a bigger loop. This will only run a second long.
You forgot to put another wait inside of the loop. So, the camera instantly goes back down when it is told to go up.
Overscores is right. All you need is just to put another wait() at the end of the loop.