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

Why does my code not work? i want to make a 1 person mode and 3 person mode by key press

Why does my code not work i am making it so when you press left shift you go from first person to third person mode

my code:

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

player.CameraMode = Enum.CameraMode.LockFirstPerson


UserInputService.InputBegan:Connect(function(input,gameprossideEvent)
	if input.KeyCode == Enum.KeyCode.LeftShift then
		player.CameraMode = Enum.CameraMode.Classic
		
		
		
	end
end)

is there a better way or a reson my code does not work?

10 comments

0

does it show any errors?

0

is it a local sceript

0

is it a localscript and in StarterPlayerScripts?

0

No errors

0

it is a local script

0

not in StarterPlayerScripts

0

put it in starterplayerscripts

0

Not working

0

Please go to the link below and follow the steps provided.

0

Please go to the link below and follow the steps. put it in starterpack and then when you click e (you can change it in the script if you want) you will be in first person and if you will press e again you will be in third person. Link is https://www.roblox.com/library/243187556/switch-from-fp-to-tp-third-person-in-a-key

1 answer

Make sure the local script is in StarterPlayerScripts. Putting it, for example, the workspace, will not work.

1 comment

0

does not work

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