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

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

Asked by 9 years ago

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...

0
Also, is there a way to get how far the player is zoomed out? Senor_Chung 210 — 9y

1 answer

Log in to vote
-2
Answered by 9 years ago

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.

0
Yeah... Senor_Chung 210 — 9y
Ad

Answer this question