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

How come this model isn't making their bricks change their properties?

Asked by 5 years ago
local Button = script.Parent

local Bricks = game.Workspace.BrickGroup1



local ClickDetector = Instance.new("ClickDetector")

ClickDetector.Parent = Button



ClickDetector.MouseClick:Connect(function()

Bricks.InvisibleBrick.Transparency = 0.5

Bricks.InvisibleBrick.CanCollide = false

Bricks.InvisibleBrick2.Transparency = 0.5

Bricks.InvisibleBrick2.CanCollide = false
Bricks.InvisibleBrick3.Transparency = 0.5

Bricks.InvisibleBrick3.CanCollide = false

end)

When a button is clicked, several parts are supposed to change their properties. However, this doesn't work. Help?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

you cant just have MouseClick you need to specify what mouseclick you are looking for, if its the left mouse button you type MouseButton1Click instead. you also need to access the clickdetector and since it seems like u just press the part to change its properties its just script.Parent.ClickDetector.MouseButton1Click:Connect(function() this will access the clickdetector and when you click it will change the properties

0
It says that MouseButton1Click isn't a valid member of ClickDetector. User#25852 0 — 5y
Ad

Answer this question