Ok, I am making a FPS game, and when I do this script.....
script.Parent = game.Players function onPlayerEntered(newPlayer) if newPlayer.ClassName == "Player" then newPlayer.CameraMode = "LockFirstPerson" end end game.Players.ChildAdded:connect(onPlayerEntered)
it locks it for everywhere I go.
How do I edit this for when I want it to lock in a particular place in a workspace?
What you could do is make an invisible part cover the area you want the player to be first person in and once the player touches it put them into first person. This would be quite simple to do initially until you are wanting to get them out of first person...
It would be something like this, utilizing the Touched
event to change the player's camera.
script.Parent.Touched:connect(function(plr) plr.CameraMode = "LockFirstPerson" end)
Then you'd have to get them out of first person either when they die or have some more invisible parts surrounding the first one, and using the same script except change line three (plr.CameraMode = "LockFirstPerson"
) to have the player's current camera...
I've not tested the script I've provided so hopefully it works, I don't see any reason why it wouldn't. If it doesn't work, please do tell me and I'll fix it. If you want a better explanation please do ask and if this answered your question please accept it with the button on the right!