So i've got this anti zoom script which doesnt let player zoom out within radius. And also whenever it does that it's guy doesnt fill the whole screen i tried adjusting gui's size heres how it looks: http://prntscr.com/86fj5l i've marked the area with yellow color.
Heres the local script
wait(0.1) local maxZoom = 50 local cam = game.Workspace.CurrentCamera local player = game.Players:GetPlayerFromCharacter(script.Parent) local gui while (not gui) do gui = script:findFirstChild("CamGui") wait() end gui.Parent = player.PlayerGui function loop() while ((player.Character) and (player.Character:findFirstChild("Head"))) do local dist = (cam.CoordinateFrame.p-player.Character.Head.Position).magnitude gui.Screen.Visible = (dist > maxZoom) wait(0.2) end end loop()
Problem There is much more efficient ways of doing this, no idea how a gui does that anyways
Solution Put this in a localscript inside the starterpack
repeat wait() until game.Players.LocalPlayer.Character local player = game.Players.LocalPlayer.Character local mindist = 10 local maxdist = 20 player.CameraMinZoomDistance = mindist player.CameraMaxZoomDistance = maxdist