Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why can i click a click detector through a gui?

I have it to where when i click a block a GUI pops up but when the GUI is up even if you can't see the click detector your mouse changes to the hand and you can click the block. Please help!

1 answer

✓ Accepted answer

put this into a local script

if game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("gui name here") then--looks after if there is the gui u got problems with in ur own gui
game.Workspace.part name here.ClickDetector.Parent = game:GetService("Lighting")--if there is that gui then it change the parent to lighting so u cant click again

put this into the gui u got problems with

script.Parent.MouseButton1Down:Connect(function()--activates the function below
--whatever u want to happen in here
    game:GetService("Lighting").ClickDetector.Parent = game.Workspace.part name here--puts back the clickdetector into the part

end)

This discussion is preserved as it was. New answers, comments, and votes are closed.