http://wiki.roblox.com/index.php?title=API:Class/Player/CameraMinZoomDistance http://wiki.roblox.com/index.php?title=API:Class/Player/CameraMaxZoomDistance
So i tried setting both those in a server script and a local script but it doesn't really work, is there something i'm doing wrong?
Thanks.
edit, heres the script:
game.Players.PlayerAdded:connect(function(Player) Player.CameraMaxZoomDistance = 50 Player.CameraMinZoomDistance = 50 Player.NameDisplayDistance = 0 end)
Put a LOCAL SCRIPT in StarterCharacterScripts , in the local script put the following:
local hum = script.Parent:WaitForChild("Humanoid") local plr = game:GetService("Players").LocalPlayer plr.CameraMaxZoomDistance = 50 plr.CameraMinZoomDistance = 50 hum.NameDisplayDistance = 0
The server never manages GUIs nor cameras, so whenever you're working with either you should always use a LocalScript.
When you're in a LocalScript, you don't want to use PlayerAdded
to try to get the current player, since the LocalPlayer was already added by the time the script runs. Instead, simply use game.Players.LocalPlayer
(or game:GetService("Players").LocalPlayer
)