|
| 29 Jul 2016 11:46 AM |
function onClicked(playerWhoClicked) Sound:Play() script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 29 Jul 2016 11:49 AM |
| you didn't end your function, and make sure you defined the variable Sound. |
|
|
| Report Abuse |
|
|
|
| 29 Jul 2016 01:16 PM |
function onClicked(playerWhoClicked) Sound:Play() local Sound = game.Workspace.GodAndreiPro.Head.Sound script.Parent.ClickDetector.MouseClick:connect(onClicked) end
What am I doing wrong? trying to learn fairly new to scripting :D |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 29 Jul 2016 01:18 PM |
script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked) local Sound = workspace:FindFirstChild("GodAndreiPro").Head.Sound if sound then Sound:Play() end end)
|
|
|
| Report Abuse |
|
|
|
| 29 Jul 2016 01:19 PM |
You're connecting the function in the function itself. Just move script.Parent.ClickDetector.MouseClick:connect(onClicked) below the end.
(Strive to improve and inspire. <-> Be inspired by those who strive to become better.) The circle of inspiration. |
|
|
| Report Abuse |
|
|