|
| 13 Oct 2013 06:36 PM |
local buzz = Workspace.Buzzing
function onTouch(hit) while true do
buzz:Play wait(0.5)
end end
What did I do wrong? |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 06:38 PM |
I think you need one more end that goes like this (Continued from what you said) end end end) Now can I have a cookie? :3 |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 06:39 PM |
@brandon
It didn't say I needed another one. |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 13 Oct 2013 06:40 PM |
'buzz:Play'
If its a sound, its actually buzz:Play() |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 06:41 PM |
@fogged :player and :Play are the same. It doesn't make a difference.
~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~ |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 06:42 PM |
Disregard my post. I made a fail typo and didn't read his post correctly. I thought he said that ":play()" should be ":Play()".
~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~ |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 06:42 PM |
I'm sorry, I did add the "()."
This is the exact script from RS, not my memory.
local buzz = Workspace.Buzzing
while true do function onTouch(hit) buzz:Play() wait(1) end end |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Oct 2013 07:12 PM |
That script is completely wrong. There's hardly a snippet of correct code. Explain what you want to happen.
~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~ |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 07:19 PM |
@Eternal
There is an invisible brick. I want it to play a sound when it is touched. |
|
|
| Report Abuse |
|
|
| |
|
qrrrq
|
  |
| Joined: 27 Jan 2013 |
| Total Posts: 1252 |
|
|
| 13 Oct 2013 07:38 PM |
1.) The while loop needs to be after the function 2.) You never called the function |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 07:46 PM |
@qrrrq
How do I "call the function?" |
|
|
| Report Abuse |
|
|
| |
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 13 Oct 2013 08:04 PM |
Put this script in the invisible Brick
local buzz = game.Workspace.Buzzing local brick = script.Parent
function onTouch(hit)
buzz:Play wait(0.5)
end
brick.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
| |
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 13 Oct 2013 08:11 PM |
Np :) and when you use functions you always have to add that last line I put with the :connect It's so the script knows when to start that function :) You can look up more types of connections in the wiki |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2013 08:19 PM |
Erm...
function arguments expected near "wait" |
|
|
| Report Abuse |
|
|
Grove537
|
  |
| Joined: 05 Feb 2010 |
| Total Posts: 3478 |
|
|
| 13 Oct 2013 08:22 PM |
buzz = game.Workspace.Buzzing brick = script.Parent
function onTouch()
buzz:Play wait(0.5)
end
brick.Touched:connect(onTouch)
Maybe try this? |
|
|
| Report Abuse |
|
|