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

How do I make a GUI so players can only zoom out to a certain extent?

Asked by 9 years ago

I know quite a bit about programming, but this is something I really need. Something similar to The Mad Murderer's anti-zoom out GUI/Script

2 answers

Log in to vote
1
Answered by 9 years ago

Players in the Players area of the game now have a new property called "CameraMaxZoomDistance". Just use a script that Edits that property when the Player joins, something like this:

Player = game.Players.LocalPlayer

function cameraZoom()
Player.CameraMaxZoomDistance = 25
end

game.Players.PlayerAdded:connect(cameraZoom)

Just make sure it's a LocalScript and you're set.

0
It's not seeming to work.. frogfriend99 10 — 9y
0
Make sure that the property is actually named CameraMaxZoomDistance, I may have gotten that part wrong. SlickPwner 534 — 9y
Ad
Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

That should work, but I would use a server script in ServerScriptService or workspace. If you try to use a local script from workspace, it will not work. Local scripts only run in three areas:

In a player's Backpack (can be indirectly, through a Tool or HopperBin) In a player's character model In a player's PlayerGui

Also, in Slick's script every time a player joins the game EVERY player's CameraMaxZoomDistance is changed, which isn't as efficient as it could be. Although you could check if the CameraMaxZoomDistance is already set to 25, I would just use a server script.

game.Players.PlayerAdded:connect(function(plr)
    plr.CameraMaxZoomDistance = 25
end)

Answer this question