I want it to be like when you hold click on the brick it disappears and when you let go it reappear, but i am not sure how i do it.
function hold() script.Parent.Transparency = 1 end function unhold() script.Parent.Transparency = 0 end script.Parent.ClickDetector.MouseClick:connect(hold) -- my problems i don't know if MouseClick is correct script.Parent.ClickDetector.MouseClick:connect(unhold) -- my problems i don't know if MouseClick is correct
In order to do this, you would have to access the players mouse. Try this:
function hold(Plr) script.Parent.Transparency = 1 local Val=Plr.PlayerGui.MouseValue repeat wait() until Val.Value==false or Plr==nil script.Parent.Transparency=0 end script.Parent.ClickDetector.MouseClick:connect(hold)
Try using that script. I think that it should work, but if not, leave a comment below, and I'll see what I can do.
UPDATE:
Put that first script I updated in the original brick, and then put a BoolValue (Name it MouseValue(Or something else)) in the Startergui with this LOCALscript in it:
Plr=game.Players.LocalPlayer Mouse=Plr:GetMouse() Mouse.Button1Down:connect(function() script.Parent.Value=true end) Mouse.Button1Up:connect(function() script.Parent.Value=false end)
Sorry about the long wait. This is untested only because I don't have time right now. Go ahead and test it and tell me how it works. Make sure you do everything correctly, and I think it should. Again, sorry for the long wait.