Shake script doesnt work on a serverscript

hi, so my shake script isnt working
more specifically, it works on a localscript, but not a serverscript.
the code im working with:

for i = 1, 20 do
local x = math.random(-100,100)/100
local y = math.random(-100,100)/100
local z = math.random(-100,100)/100
Humanoid.CameraOffset = Vector3.new(x,y,z)
print(i)
wait()
end

(humanoid is specified earlier in the LONG script)
anyone have an idea whats causing it not to work?

2 Likes

It’s because only a local script can affect the local player’s camera. Since a server script is not bound to any specific player, it can’t act on any of the player’s properties, including their camera.

2 Likes