How to disable movement when a gui is visible?
Asked by
4 years ago Edited 4 years ago
i have been having problems with this code. I want to make it stop an movement of the player when that frame is visible. I tried the script below but if didn't work (i took the movement control script from roblox's devforum). PLease help, thnx
ps: I am new so i am bad at scripting
01 | local UIP = game:GetService( "UserInputService" ) |
03 | if game.StarterGui.ScreenGui 2. Frame.Visible = = true then |
04 | if UIP.UserInputType = = Enum.UserInputType.Keyboard then |
05 | if UIP.KeyCode = = Enum.KeyCode.W and Enum.KeyCode.A and Enum.KeyCode.S and Enum.KeyCode.D then |
06 | local controls = require(game:GetService( "Players" ).LocalPlayer.PlayerScripts.PlayerModule):GetControls() |