local c = workspace.CurrentCamera local p = game.Players.LocalPlayer workspace.ChildAdded:Connect(function(Child) if Child:IsA("Explosion") then Shake() end end) function Shake() for i = 1, 20 do wait() local RandomizerX = math.random(-70,70) local RandomizerY = math.random(0,70) local RandomizerZ = math.random(-70,70) p.Character.Humanoid.CameraOffset = Vector3.new(math.rad(RandomizerX, 15, RandomizerZ)) end p.Character.Humanoid.CameraOffset = Vector3.new(0,0,0) end
It only changes the X axis, any fix?
You reason the script isn't working is be you are giving Vector3.new() a single value as well as giving math.rad 3 values when it only accepts one.
To fix this simply wrap each value with its own math.rad
local c = workspace.CurrentCamera local p = game.Players.LocalPlayer workspace.ChildAdded:Connect(function(Child) if Child:IsA("Explosion") then Shake() end end) function Shake() for i = 1, 20 do wait() local RandomizerX = math.random(-70,70) local RandomizerY = math.random(0,70) local RandomizerZ = math.random(-70,70) p.Character.Humanoid.CameraOffset = Vector3.new(math.rad(RandomizerX), math.rad(15), math.rad(RandomizerZ)) end p.Character.Humanoid.CameraOffset = Vector3.new(0,0,0) end