I want a click function to only fire when a player clicks and isn’t hitting a gui, similar to touchtapinworld for touch enabled devices. How could I do that?
well first you can handle the click function to not fire when it is hitting a roblox GUI. With:
local plr = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input,processed)
if processed then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
print("gucci")
end
end)```
1 Like
Basically this checks if you are clicking something that isn’t doing something. So I suppose the click function wouldn’t fire if it clicks a textbutton.
Exactly what i needed. Thank you
1 Like