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

why can i click a click detector through a gui?

Asked by 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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)

Ad

Answer this question