game is first person and So I made script that will make mousebehavior default when shop is opened so player can move cursor freely but game does not even detect if that ScreenGui is enabled...

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
local UserInputService = game:GetService("UserInputService")
if script.Parent.ToolShop.Enabled == true then
	print("HI")
	UserInputService.MouseBehavior = Enum.MouseBehavior.Default

end

if script.Parent.ToolShop.Enabled == false and script.Parent.RealMenu.Enabled == false then

	UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
end



it does not even print "HI"

4 comments

0

you could try checking if the gui is visible or not, idk if im understanding the situation properly but that was just my first thought

0

So situation is I am checking whether that GUI is enabled or not, but it does not do anything when toolshop.enabled becomes true

0

if you want the mouse to move freely when opening the shop enable modal on one of the buttons

0

Will try, thanks