I need a player to be able to click a block, and then it plays audio. How do I do this?
a = false script.Parent.ClickDetector.MouseClick:connect(function(player) if a == false then game.Workspace.Audio:Play() a = true else game.Workspace.Audio:Stop() a = false end end)
@Capin, I'll help you out with that.
a = false script.Parent.ClickDetector.MouseClick:connect(function(player) if a == false then game.Workspace.Audio:Play() a = true else game.Workspace.Audio:Stop() a = false end end)
For TextButtons:
a = false script.Parent.MouseButton1Down:connect(function(player) if a == false then game.Workspace.Audio:Play() a = true else game.Workspace.Audio:Stop() a = false end end)
script.Parent.ClickDetector.MouseClick:connect(function(player) game.Workspace.Audio:Play() end)
This is assuming the script is in the part, and the audio is called Audio, you can change it accordingly.