Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't my camera shake? Works on Solo!

Asked by 10 years ago

It works fine in Solo mode but when I try and play it normaly it will not work? Any help? My script is a normal script. Thanks! :) Credit will be given at my game :)

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

while true do 
    wait(0.01)
    shake()
end 

1 answer

Log in to vote
2
Answered by
DataStore 530 Moderation Voter
10 years ago

A player's camera can only be manipulated by a LocalScript. The reason it worked in solo mode with a "normal script" is due to the fact that everything is locally loaded in that test mode.

Simply put the contents of the script into a LocalScript and place it somewhere within the player, such as their PlayerGui (via StarterGui).

0
Okai let me try ;) WelpNathan 307 — 10y
0
Yep. Works great! Thank you! :) WelpNathan 307 — 10y
Ad

Answer this question