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

Why won't this localscript zoom up to my mouse?

Asked by 10 years ago

Like i try to zoom up to my mouse with a gun so ya. This doesn't work.

sp = script.Parent


local player = game.Players.LocalPlayer
local mouse = player:GetMouse()


function zoom(key)
    key = key:lower()
    if key and key == "z" then
        local cam = game.Workspace:FindFirstChild("Camera")
        if cam then
            cam.Focus = CFrame.new(mouse, 0, 0)
        end
    end
end

mouse.KeyDown:connect(zoom)

Why won't it zoom up?

Answer this question