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

Making a click detector for a button, code seems correct but isn't working?

Asked by 3 years ago
Edited 3 years ago

The script below is me trying to make a button when clicked makes the button invisible as well as the rest of the model attached to the button, i'm normally good at this stuff but i'm confused why my code is not working in the sense that the icon to click isn't coming up, it won't click. It is inside a normal script, a neon colour to the brick, i am trying to make one of the click the button games but somehow it isn't working, any help would be great, thanks.

local stand = game.workspace.Stand
local standtip = game.workspace.StandTip
local button = script.Parent
local ClickDetector = Instance.new("ClickDetector")
ClickDetector.Parent = button
ClickDetector.MaxActivationDistance = 15

ClickDetector.MouseClick:Connect(function()
    button.Transparency = 1
    stand.Transparency = 1
    standtip.Transparency = 1
    button.CanCollide = false
    stand.CanCollide = false
    standtip.CanCollide = false
end)
0
like come on give us some details about it, how are we supposed to know what is causing the problem? What exactly is not working? Is it LocalScript? Are there errors in the output? If you put more effort into the question then it is more likely that someone is going to solve it. imKirda 4491 — 3y
0
sorry TgaTheGoldenArmour 15 — 3y
0
The script should work. Please send us the error message (if any) and check that all the variables are defined as the correct part. KingDomas 153 — 3y
0
try removing `game.` in `game.workspace` or capitalize `workspace` such as using `game.Workspace` krowten024nabrU 463 — 3y

Answer this question