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

Camera Limit not working properly?

So I have a really basic script here that is supposed to limit the max distance a character can zoom out, and it works as expected in studio but it does nothing when I'm in an actual game. The script is located under Workspace and is not a local script, just a regular server script.

Here is the script, it's literally 2 lines.

wait(0.1)
game:GetService("Players").LocalPlayer.CameraMaxZoomDistance = 10

1 answer

✓ Accepted answer

You cannot use "LocalPlayer" using a Server-Script. I recommend changing it to a LocalScript and putting the script under "StarterGui"

If you want to keep it in a server-script, change the code to:

game:GetService("StarterPlayer").CameraMaxZoomDistance = 10

2 comments

0

Thanks for the help, dumb mistake on my part lol.

0

Any time!

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