Replace the script with a localscript. LocalPlayer can’t be accessed in a normal script.
2 Likes
Use this.
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local toggle = false
mouse.Button1Down:Connect(function()
if toggle == false then
player.CameraMaxZoomDistance = 0
player.CameraMinZoomDistance = 0
elseif toggle == true then
player.CameraMaxZoomDistance = game.StarterPlayer.CameraMaxZoomDistance
player.CameraMinZoomDistance = game.StarterPlayer.CameraMinZoomDistance
end
toggle = not toggle
end)
1 Like
aaa yes thnx alot now im gonna make a button to go back to normal but now that i have the script its gonna be ez