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

how do i make a script that says zoom in to play?

Asked by 10 years ago

how do i make a script that says zoom in to play?

2 answers

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

I would recommend just setting a player's camera mode to LockFirstPerson.

game.Players.PlayerAdded:connect(function(p)
    p.CharacterAdded:connect(function(chr)
        p.CameraMode = "LockFirstPerson"
    end)
end)
0
True. Tesouro 407 — 10y
Ad
Log in to vote
1
Answered by
Tesouro 407 Moderation Voter
10 years ago

Check the distance from the head of the character to the camera position.

while wait() do -- just a loop to refresh
    if (game.Players.LocalPlayer.Character.Head.Position - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude > 20 then
        script.Parent.BackgroundTransparency = 0 -- script.Parent is a Frame covering all screen
    else
        script.Parent.BackgroundTransparency = 1
    end
end

If it's more than 20 studs away from your head (for example), it will block your view.

Answer this question