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

Where to put my LocalScript?

Asked by 10 years ago

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

Log in to vote
1
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago

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


repeat wait() until game.Players.LocalPlauer game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
0
It works, thanks. Adam335 5 — 10y
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. nate890 495 — 10y
0
No, it doesn't. Adam335 5 — 10y
Ad
Log in to vote
1
Answered by 10 years ago
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.

Answer this question