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

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

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

2 answers

✓ Accepted answer

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)

1 comment

0

True.

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.

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