I have made a script where once the player clicks "Play" on the menu, it makes the menu disappear and locks him in first person (Like in Phantom Forces, kind of.) The only problem I have with this script is that when the player dies, he is still locked into first person and is unable to click any of the buttons. Here is my script so far:
script.Parent.MouseButton1Down:connect(function() bin = script.Parent function Clicked() bin.Parent.Visible = false end bin.MouseButton1Down:connect(Clicked) game.Players.LocalPlayer.CameraMaxZoomDistance = .5 end) bin = script.Parent function Clicked() bin.Parent.Visible = false end bin.MouseButton1Down:connect(Clicked)
I want it so that when the player dies, he will be unlocked from first person to freely move around the menu.
You can use the Died event and just set the MaxZoom to whatever you want.
Example:
game.Players.LocalPlayer.Character.Humanoid.Died:connect(function() game.Players.LocalPlayer.CameraMaxZoomDistance = 20 end)
I may have made a mistake, as I typed this without testing. Hope this helped!