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)
This new script works when i tested it.
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 wait(.1) end c.CameraType = "Custom" end)
You forgot a second wait so it just instantly jumped down and up again so visual nothing happened.