Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Where to put my LocalScript?

So, I'm trying to make a LocalScript that forces players into first person. Here's the code;

game.Players.LocalPlayer.CameraMode = "LockFirstPerson"

So, where do I put the LocalScript? So far, it only works in solo mode. I want it to be able to work in online mode.

2 answers

CameraMode can be finicky. Either put it in StarterGui or StarterPack.


repeat wait() until game.Players.LocalPlauer
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"

3 comments

0

It works, thanks.

0

Does it work in online after reseting? You may have to change the CameraMode back to Classic and then switch it back to LockFirstPerson.

0

No, it doesn't.

while (not game.Players.LocalPlayer) do wait() end
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson

Just a note, a while loop can be used to only run the wait() when needed. If you use a repeat loop it will always run the wait even if what you are trying to verify is already existent.

This discussion is preserved as it was. New answers, comments, and votes are closed.