How can I do that?
print(game.Players.LocalPlayer:WaitForChild(“PlayerGui”,5):GetGuiObjectsAtPosition(mouse.X, mouse.Y))
So that it also recognizes the coreGui? At the moment it only sees my GUIs.
How can I do that?
print(game.Players.LocalPlayer:WaitForChild(“PlayerGui”,5):GetGuiObjectsAtPosition(mouse.X, mouse.Y))
So that it also recognizes the coreGui? At the moment it only sees my GUIs.
This post is almost a month old, but for anyone else with the same question: No. Roblox intentionally makes it as difficult as possible to access the CoreGui
. If developers could know when certain CoreGui
s were open, like the Report Abuse menu, it would let them prevent players from reporting other players in their server.
However, they have whitelisted specific GUIs, and you can check whether they are open or not with StarterGui:GetCoreGuiEnabled
:
I actually just want to know if the Core GUI is open, and if not, if the mouse cursor is over a CireElement. For example, the leaderboard, so that when the user clicks, no block is placed behind it. The same with the Roblox icon.
If you are using UserInputService
, you can make use of the second parameter to InputBegan
which specifies whether the engine has already handled an interaction with the input, most notably with UI buttons and TextBox
es:
UserInputService.InputBegan:Connect(function(Input, WasProcessed)
-- `WasProcessed` will be true if the input was performed on a button or textbox
if WasProcessed then
return
end
-- If the player typed "E" in Chat without the above code,
-- the player would have interacted with an object when they were
-- just trying to say something.
if Input.KeyCode == Enum.KeyCode.E then
Interact()
end
end)
According to the above, there’s something similar for ContextActionService
bindings, but I’m not sure what it is referring to.