01 | sparkles = Instance.new( "Sparkles" ) |
02 | sparkles.Parent = Brick |
03 | wait( 5 ) |
04 | Brick = script.Parent |
05 | Sound = Brick.Sound |
06 |
07 | function onClicked() |
08 | Sound:Play() |
09 | end |
10 |
11 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
The complete code is almost completely good, just have to add a few more things. The finish code would be:
01 | local Brick = script.Parent |
02 | local Sound = Brick.Sound |
03 |
04 | function onClicked() |
05 | sparkles = Instance.new( "Sparkles" ) |
06 | sparkles.Parent = Brick |
07 | Sound:Play() |
08 | wait( 5 ) |
09 | sparkles:Destroy() |
10 | Sound:Stop() |
11 | end |
12 |
13 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
hope this helped! i