|
| 29 Mar 2014 05:02 AM |
| How do I make it so that if presses left click while holding a tool, an audio plays |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 29 Mar 2014 06:07 AM |
tool = script.Parent
tool.Activated:connect(function() Sound:Play() end) |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
|
| 29 Mar 2014 06:29 AM |
@Compy
"clicks"(WHILE HOLDING) |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 29 Mar 2014 06:58 AM |
tool.Activated won't connect if you don't have the tool equipped as long as I remember. Tool activated
Description of Activated(): Fired when the player clicks while a tool is equipped. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
|
| 29 Mar 2014 07:04 AM |
@Compy
he means left click the mouse while he already is equipped with the tool .-.
xd |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
| |
|
|
| 30 Mar 2014 05:34 AM |
@baheeg compy's script is right. @compy What if he clicked again? You'd need to stop the audio before it plays again so that the audio isn't spammed.
When life gives you lemons... BURN HIS HOUSE DOWN! >:D |
|
|
| Report Abuse |
|
|
compy111
|
  |
| Joined: 02 Apr 2009 |
| Total Posts: 583 |
|
|
| 30 Mar 2014 06:28 AM |
He asked to play it, not to stop ;-)
But when you add a sound there is a property called: 'Looped'. If you uncheck that it will stop after playing once. |
|
|
| Report Abuse |
|
|