Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to Make a Player Frozen While in Opened GUI?

Asked by 6 years ago

While a player has a GUI frame open on their screen, they can still move around. How can I make it so the player character is frozen in place while they have the GUI open, and when they close it they unfreeze.

Also, if possible, how can I make it so the player can't move around their POV camera while the GUI is open, but can move it around when the GUI is closed?

2 answers

Log in to vote
-1
Answered by 6 years ago

You can use RemoteEvents as they can transfer data from and to client and server. So if someone presses a button or a script detects if something is visible or not, the RemoteEvent can fire from a local script and a server script will make the player frozen.

Since I don't know much about camera manipulation, a way I would make people stop moving their camera around is make a frame, resize the frame so it covers the whole screen, make it active in properties, then make it transparent if you don't want players to see it. It's not the best way as people can still move their camera with arrow keys and I/O, but they at least can't move it around with their mouse.

Hope this helped, and sorry if I made the answer a little too long. :P

If you need to learn more about RemoteEvents, here's a tutorial about it :

http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions

0
Remote events aren’t required to freeze the character, and you don’t need a frame to stop camera movement. mattscy 3725 — 6y
0
Oh. I didn't know I could change a player's humanoid properties using a localscript with FE. Thank you! But for the camera part I said I don't know much about camera manipulation, and I didn't say my way was the best way. I'll fix my answer soon. User#20279 0 — 6y
Ad
Log in to vote
1
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

You could put something like this in a local script inside the gui:

Gui open:

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Players.LocalPlayer.DevComputerMovementMode = Enum.DevComputerMovementMode.Scriptable
game.Players.LocalPlayer.DevTouchMovementMode = Enum.DevTouchMovementMode.Scriptable

Gui close:

workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
game.Players.LocalPlayer.DevComputerMovementMode = Enum.DevComputerMovementMode.UserChoice
game.Players.LocalPlayer.DevTouchMovementMode = Enum.DevTouchMovementMode.UserChoice

Answer this question