ColdxN
|
  |
| Joined: 19 Mar 2012 |
| Total Posts: 79 |
|
|
| 03 Sep 2016 05:34 PM |
im trying to make a script where a sound plays when a gui button is clicked but it wont work.
local Sound = script.Parent function MouseButton1Click:connect Sound:Play() end |
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 05:38 PM |
local Sound = script.Parent or u can just put the sound into workspace and do local Sound = game.Workspace.Sound
function MouseClick() Sound:Play() end
script.Parent.MouseButton1Down:connect(MouseClick)
|
|
|
| Report Abuse |
|
|
|
| 03 Sep 2016 05:44 PM |
SoundName = "Sound" -- Enter name of sound and put it in the button
script.Parent.MouseButton1Click:connect(function() script.Parent:FindFirstChild(SoundName):Play() end) |
|
|
| Report Abuse |
|
|