Any fixes so it would work in online mode?

function shake()
	local camera = game.Workspace.CurrentCamera
	for i = 1,10 do	
		wait()
		camera.CoordinateFrame = camera.CoordinateFrame * CFrame.new(0,0.5,0)
		wait()
		camera.CoordinateFrame = camera.CoordinateFrame * CFrame.new(0,-0.5,0)
	end 
end 

while true do 
	wait(0.01)
	shake()
end 

5 comments

0

My guess is you put this in a server Script. Only LocalScripts can access the camera.

0

I've put it into a LocalScript

0

Where is the localscript?

0

workspace

0

LocalScripts only work in the player, you could put this in startergui or something.