So im making a gui and i want the buttons to play a sound when somebody click on it i tried doing
Helpbutton.MouseButton1Click:Connect(function() Help.Sound:Play wait(.1) Help.Sound:Stop end)
but then this error comes
Players.Noman538.PlayerGui.Help.LocalScript:3: Expected '(', '{' or <string>, got 'wait'
Play
and Stop
are both methods of Sound
. In other words, they're functions. Basic syntax requires parentheses to wrap the function call as a form of providing arguments to the given parameters. Even without parameters that are built into functions, this practice is still mandatory across all languages. To fix this issue, place a pair of parentheses at the respective places.
Sound:Play() Sound:Stop()