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 » Scripters
Home Search
 

Re: Sound Overlaps, doesn't stop playing after repeat loop

Previous Thread :: Next Thread 
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 07:44 PM
I am having trouble in my script. The game plays music and then stops it after a repeat loop. However, the music doesn't stop playing and just overlaps with the music that plays afterwards. How can I prevent this?
Here is the code:

local sounds = game.Workspace.RoundMusic:GetChildren()
local sound = sounds[math.random(1,#sounds)]
local soundd = sound:Clone()
soundd.Parent = game.Workspace
soundd:Play()
local sum = 0
local num = 0
local tiem = 120 --[[120]]
repeat
sum = 0
for p,d in pairs (game.Players:GetChildren()) do
coroutine.resume(coroutine.create(function()
d.PlayerGui.TopBar.Frame.TextLabel.Text = "There are "..tiem.." seconds left to tag the runners!"
end))
if d.RoleVal.Value == 1 then
sum = sum + 1
end
if d.RoleVal.Value == 2 then
num = num + 1
end
end
tiem = tiem - 1
wait(1)
until tiem == 0 or sum == 0 or num == 0
soundd:Stop()
soundd:Destroy()
wait(1)
local soundss = game.Workspace.Sounds:GetChildren()
local soundw = soundss[math.random(1,#soundss)]
local sounddd = soundw:Clone()
sounddd.Parent = game.Workspace
sounddd:Play()
sounddd:Destroy()
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 07:51 PM
b1
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 07:53 PM
b2
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 07:55 PM
b3
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 08:06 PM
b4
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 08:10 PM
b5
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 08:16 PM
b6
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
15 May 2015 08:32 PM
Theres one in my models i made today.
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 08:51 PM
that has nothing to do with anything

b7
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 08:54 PM
b8
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 08:58 PM
b9
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 09:15 PM
b10
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
15 May 2015 09:15 PM
My script works and i gave you it. just use mine and edit it newb
Report Abuse
FOXmcloud021 is not online. FOXmcloud021
Joined: 14 Apr 2012
Total Posts: 3512
15 May 2015 09:21 PM
Maybe make it onsale before you call me a newb, mk?

b11
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
15 May 2015 09:27 PM
sorry, i forgot. mk? its forsale now.
Report Abuse
drager980 is not online. drager980
Joined: 25 May 2009
Total Posts: 13385
15 May 2015 09:28 PM
nice manners guys, almost as bad as mine



AND THE TIGER GOES ROAR
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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