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

Why does this not work after I do it one time?

I have a script that smoothly zooms you in when you select it, and zooms you back out when you don't have it equipped it, but when you equip the tool, than unequip it, you don't zoom back out.

Here is the script

c = game.Players.LocalPlayer.CameraMaxZoomDistance

script.Parent.Equipped:connect(function()
	c = 70
	for i = c,0,-1 do
		game:GetService("RunService").RenderStepped:wait()
		game.Players.LocalPlayer.CameraMaxZoomDistance = i
		print (game.Players.LocalPlayer.CameraMaxZoomDistance)
	end
	game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
end)

script.Parent.Unequipped:connect(function()
	game.Players.LocalPlayer.CameraMode = "Classic"
	c = .5
	for i = c,70,-1 do
		game:GetService("RunService").RenderStepped:wait()
		game.Players.LocalPlayer.CameraMaxZoomDistance = i
		print (game.Players.LocalPlayer.CameraMaxZoomDistance)
	end
end)

no output either. I'm stumped...

1 comment

0

Also, is there a way to get how far the player is zoomed out?

1 answer

Is it in a local script? And yes there is way to make the make the player in FPS, just go to StarterPlayer and change the CameraMaxZoomDistance in properties.

1 comment

0

Yeah...

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