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

how to make it so that when you press "V", your camera view will go first person or vice versa?

aaaaaaaaaaaaaaasfasjfasiofjiowjqiojtiqwitjwqiotqjoigjagss

20 chars

4 comments

0

There is no effort put into your question, so I will put no effort into answering it for you.

0

diz queztion hurtz ;C u hurtz my feelingz ;-;

0

To be serious, please put some effort in. We're human too; we're not bots.

2 answers

For Future Reference: Please at least try to attempt writing the code. A lot of people will rage at you if you don't.

Anyway I took a little time and wrote the following code. It is pretty basic and straightforward.

-- Declaration Section 

local player = game:GetService("Players").LocalPlayer 
local userInputService = game:GetService("UserInputService")
local status = "Third"

-- Processing Section 

userInputService.InputBegan:Connect(function(key, gameProcessedEvent)
	if not gameProcessedEvent then
		if key.KeyCode == Enum.KeyCode.V then
			if status == "Third" then 
				print ("Changing to First Person Mode!")
				player.CameraMode = "LockFirstPerson"
				player.CameraMaxZoomDistance = 0.5
				print ("First Person Mode Initialized!")
				status = "First"
			else 
				print ("Reverting to Third Person Mode!")
				player.CameraMode = "Classic"
				player.CameraMaxZoomDistance = 400
				player.CameraMinZoomDistance = 15
				print ("Third Person Mode Initialized!")
				status = "Third"
			end
		end
	end
end)
If this helped, please flag this as answered. Have a nice evening.

2 comments

0

People also don't like it when people just request what they want, and have a filler description, with no attempt at trying anything out for themselves at all.

0

^ Yes my guy.

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