|
| 25 Jan 2015 02:17 PM |
I'm new to scripting, so if this is way off, that's the reason. Here's my script:
local part = game.Workspace.Part
function onTouch(part) part.Sound:play() wait(5) part.Sound:Stop() end
part.Touch:connect(onTouch)
I entered the sound ID in the Workspace thing, is there anything I could be missing ?
|
|
|
| Report Abuse |
|
|
iGotRekt
|
  |
| Joined: 23 Jan 2014 |
| Total Posts: 831 |
|
|
| 25 Jan 2015 02:20 PM |
"part.Sound:play()" :Play()
✗ вυяиσυт699 » ɪGᴏᴛRᴇᴋᴛ |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 02:24 PM |
@iGot Not case sensitive.
Are there multiple objects named "part" in workspace? |
|
|
| Report Abuse |
|
|
iiLinked
|
  |
| Joined: 05 Oct 2012 |
| Total Posts: 42 |
|
|
| 25 Jan 2015 02:28 PM |
if its in a group then do this local part = game.Workspace.(put the name here like if you just did it without renaming it would be Model).Part
function onTouch(part) part.Sound:play() wait(5) part.Sound:Stop() end
part.Touch:connect(onTouch)
|
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 02:33 PM |
@Eternal, Yes, I realised that and changes the name of the part to 'Brick', as well as the ones in the script.
@iiLinked, No, it's not in a group.
Still doesn't work. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 02:47 PM |
Try this: ----- part = workspace.Brick; d = false;
part.Touched:connect(function(h) if d == false then d = true; part.Sound:play(); wait(5); part.Sound:stop(); wait(); d = false; end end) ----- |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 25 Jan 2015 02:50 PM |
wtf are you all doing..
local db = false
script.Parent.Touched:connect(function(p) if p:FindFirstChild("Humanoid") then if not db then db = true script.Parent.Sound:Play() db = false end end end)
R$3,070 |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 02:52 PM |
@02 Take a look at the OP's code. He only wants to play 5 seconds of the sound. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2015 02:56 PM |
| Thanks! It works now. I appreciate your help. |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 25 Jan 2015 03:51 PM |
Easy explaination
You made 2 parameters both called part |
|
|
| Report Abuse |
|
|