|
| 14 Mar 2014 01:49 PM |
local sound = Instance.new("Sound") sound.SoundId = "http://www.roblox.com/asset/?id=27697743" sound.Parent = game.Workspace.MusicBlock
This is directly from wiki because I just want to ask a few questions about it.
So first, could I use the parent as script.Parent? Like this: sound.Parent = script.Parent
Second: If I do Sound:Play, will it play it to the end if I did something like: Sound:Play Sound:Destroy()
Or would I have to do: Sound:Play wait(time of the sound) Sound:Destroy
Sorry for asking this much but I haven't messed much with sounds and I want to experiment a little.
|
|
|
| Report Abuse |
|
|
Xulp
|
  |
| Joined: 24 Apr 2012 |
| Total Posts: 451 |
|
|
| 14 Mar 2014 01:50 PM |
| Play doesn't wait for you, so you'd have to do it manually. |
|
|
| Report Abuse |
|
|
Nhelp
|
  |
| Joined: 05 Aug 2011 |
| Total Posts: 11557 |
|
|
| 14 Mar 2014 01:52 PM |
If you do this
"Sound:Play Sound:Destroy() "
it will destroy itself when it starts playing. It might also give you an error because "Sound" is not a defined value.
I think sounds just stop after the music stops, but I might be wrong
Either way, do this to be sure:
sound:Play() wait(time of the sound) sound:Destroy() |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2014 01:53 PM |
Also if I insert a sound into the tool, and I do:
script.Parent.SoundName:Play()
Would it work? |
|
|
| Report Abuse |
|
|