Tonitoni
|
  |
| Joined: 14 Mar 2009 |
| Total Posts: 6429 |
|
|
| 20 Apr 2014 11:42 AM |
local sound = script.Parent.Suspense local enabled = true -- Debounce local touchbrick = script.Parent
-- Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=142285032")
function onTouched(hit) print(hit) if enabled == true then sound:Play() print("Sound playing") enabled = false -- Debounce wait(120) touchbrick:Destroy() end end
script.Parent:connect(onTouched)
No output, not even from the prints... |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 20 Apr 2014 11:44 AM |
| Connection line is wrong. script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
Tonitoni
|
  |
| Joined: 14 Mar 2009 |
| Total Posts: 6429 |
|
|
| 20 Apr 2014 11:50 AM |
| Ah, thanks! Also, is it so that you cannot use variables for the connection line? I tried writing touchbrick:connect(onTouched)but the script wouldn't work when I did that. |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 20 Apr 2014 11:56 AM |
| You would have to do touchbrick.Touched. Because touched is the event you are connecting the function to |
|
|
| Report Abuse |
|
|