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

I really need help, I have first person game and when I open shop I can't detect it ?

Asked by 2 years ago

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"

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 therealjimmybob 22 — 2y
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 Sabailuridze 126 — 2y
0
if you want the mouse to move freely when opening the shop enable modal on one of the buttons Puppynniko 1059 — 2y
0
Will try, thanks Sabailuridze 126 — 2y

Answer this question