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: A way to detect the end of a song/sound?

Previous Thread :: Next Thread 
Dondonini is not online. Dondonini
Joined: 21 Dec 2007
Total Posts: 734
13 Mar 2014 04:16 AM
I don't know if I worded it right, but yeah.

I've been trying to find a way to detect if a sound instance is done playing. For example:
Finding detect if the song is done so I can play the next one.

Is there a way? Been trying to figure this out for 2 months now.

-- dondonini Studios™
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
13 Mar 2014 04:18 AM
prolly the isplaying property in it.
Report Abuse
Dondonini is not online. Dondonini
Joined: 21 Dec 2007
Total Posts: 734
13 Mar 2014 04:20 AM
I've tried that too many times. Realized that it only detects if the sound HAS BEEN played. :(

-- dondonini Studios™
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
13 Mar 2014 04:23 AM
:'(, prolly put a boolvalue inside that sound and make a script that has the same LENGTH wait seconds, and then after the wait is finished (wait(samelength of your sound) set that boolvalue to true and then make the other scripts detects when the boolvalue change its value and an ifs condition whether it changes to true and if it changes to true it means the sound staphed playing.
Report Abuse
Cawlonee is not online. Cawlonee
Joined: 03 Mar 2014
Total Posts: 2687
13 Mar 2014 04:42 AM
The changed event doesn't register?

I would think that the isPlaying property would work.
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
13 Mar 2014 04:52 AM
playing = false

while wait() do
if sound.isPlaying == true then
playing = true
else
playing = false
end
end
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
13 Mar 2014 06:30 AM
Even though this thread is dead atm



You don't.

You cannot detect when a sound has stopped playing unless you physically stop it.
Report Abuse
Dondonini is not online. Dondonini
Joined: 21 Dec 2007
Total Posts: 734
13 Mar 2014 01:50 PM
^^ Sigh. I've noticed now. I hope there is a way around this soon. :(

BTW. Who ever was talking about making a script that waits for the exact length of the song. I'm trying to make it work on a variety of songs. So that won't work. :(

-- dondonini Studios™
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Mar 2014 01:59 PM
Playing = false
Sound:Play()
Playing = true
repeat
wait(0.001)
if Sound.IsPlaying = false then
Playing = false
end
until Playing = false


Woud that not work?
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
13 Mar 2014 02:12 PM
@War
Wait() cannot be any shorter than 0.033333333 (repeating)
The fastest wait you can get is game:GetService("RunService").RenderStepped:wait()

RenderStepped is equal to 0.01666666666 (repeating)


Follow me on twitter: @Jonibus_RBX
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
13 Mar 2014 02:13 PM
Also if statements require two equals signs
if value == true then
end

And why do you have the repeat and end placed like that? Doesn't make much sense to me.

Follow me on twitter: @Jonibus_RBX
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Mar 2014 02:57 PM
Sorry messed up on == and if I do wait(0.0000000000000000000001) Wouldn't it round to the lowest possible
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
13 Mar 2014 02:59 PM
*Refer to my post about unable to detect the end of a sound*
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