sparkles = Instance.new("Sparkles") sparkles.Parent = Brick wait(5) Brick = script.Parent Sound = Brick.Sound function onClicked() Sound:Play() end 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:
local Brick = script.Parent local Sound = Brick.Sound function onClicked() sparkles = Instance.new("Sparkles") sparkles.Parent = Brick Sound:Play() wait(5) sparkles:Destroy() Sound:Stop() end script.Parent.ClickDetector.MouseClick:connect(onClicked)
hope this helped! i