generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Sound questions

Previous Thread :: Next Thread 
nivleMmIiH is not online. nivleMmIiH
Joined: 17 Jan 2014
Total Posts: 78
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 is not online. 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 is not online. 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
nivleMmIiH is not online. nivleMmIiH
Joined: 17 Jan 2014
Total Posts: 78
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image