I have a Camera shake script that is supposed to shake when a remote event fires, but it doesn't work only when the remote event fires local script:
for i = 1, 600 do
print("yes")
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)
wait()
humanoid.CameraOffset = Vector3.new(-x,-y,-z)
wait()
end -- works
game.ReplicatedStorage.CameraShake.OnClientEvent:Connect(function()
for i = 1, 600 do
print("yes")
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)
wait()
humanoid.CameraOffset = Vector3.new(-x,-y,-z)
wait()
end --prints but doesnt work
end)
serverscript:
game.ReplicatedStorage.CameraShake:FireClient(Player)
does anyone know why?
