Ok, so pretty much when i press H it does change me to firstpersonlock its just when i press H again it doesn't go back.
✓ ANSWER ACCEPTED
thirdperson to firstperson back to thirdperson script not working?
1 answer
✓ Accepted answer
You have to add a variable to toggle between the 2 states, right now the code is saying that pressing H will bring you to first person while pressing any other key will bring you to third person, as evident on your if else statement
local FirstPerson = false
function onKeyPress(inputObject, gp)
if inputObject.KeyCode == Enum.KeyCode.H then
if not FirstPerson then
FirstPerson = true
game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
else
FirstPerson = false
game.Players.LocalPlayer.CameraMode = "Classic"
end
end
end
game:GetService("UserInputService").InputBegan:Connect(OnKeyPress)
also put your code in code blocks in the future so people can just copy and paste your code and edit it from there
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Will do, thank you so much!