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

My clickdetector script isn't working, and i need help..?

Asked by 5 years ago

script.Parent.MouseButton1Click:Connect(function() game.workspace.testing.CanCollide = false end)

It's anincredibly simple script. When I click this textbutton, the part that is named testing will become uncollidable.. but it isn't working?? A little help?

If you're wondering, the script's parents is a textbutton, then a frame, then surface gui, then a part, and THEN the workspace.

I'm confused on why it isn't working despite it being so simple

0
Since you are working with guis, the SurfaceGui should be in StarterGui, and you can set the Adornee to whatever part t should be adorned to, and make your script a local script because you are handling GUI input User#24403 69 — 5y
0
are you using an actual clickdetector? SteamG00B 1633 — 5y
0
I'm mixing things up Rheines 661 — 5y
0
OP is not using a click detector. But rather a SurfaceGui. Which makes the title misleading. User#24403 69 — 5y
0
yEP im sorry that the title is kind of misleading,, it isn't a click detector lightdukez125 18 — 5y

1 answer

Log in to vote
0
Answered by
SteamG00B 1633 Moderation Voter
5 years ago
local button = script.Parent
button.MouseButton1Click:Connect(function()
    workspace.testing.CanCollide = false
end)

This did work for me when I tested it, if it didn't work for you, then I'd suggest looking at the spelling of the part to make sure you don't have any capitalization errors. You might also have had the hierarchy wrong and didn't realize it?

Ad

Answer this question