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: What's wrong with this script?

Previous Thread :: Next Thread 
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:04 PM

while true do
local b = math.random(1, 2)
if b == 1 then
game.Workspace.Sound2:Play()
elseif b == 2 then
game.Workspace.Sound1:Play()
end
end
Report Abuse
1234Christopher is not online. 1234Christopher
Joined: 21 Oct 2008
Total Posts: 1715
27 Jan 2014 03:06 PM
Add a wait()
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:07 PM
Works now, but how do I make it wait until the audio is finished?
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:11 PM
Halp.
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:14 PM
.
Report Abuse
1234Christopher is not online. 1234Christopher
Joined: 21 Oct 2008
Total Posts: 1715
27 Jan 2014 03:14 PM
Work out how long the audio is then "while wait(howlong) do".
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:17 PM
This script doesn't work:



while wait(120) do
local b = math.random(1, 2)
if b == 1 then
game.Workspace.Sound2:Play()
elseif b == 2 then
game.Workspace.Sound1:Play()
end
end
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:20 PM
halp....
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:24 PM
Wait, would that wait 2 minutes before putting the first sound? I don't want it like dat.
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:32 PM
halp.
Report Abuse
thetacah is not online. thetacah
Joined: 18 Jan 2013
Total Posts: 16026
27 Jan 2014 03:54 PM
Halp.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
27 Jan 2014 03:58 PM
while not game.Workspace.Sound1.IsPlaying or not game.Workspace.Sound2.IsPlaying do
wait()
local b = math.random(1, 2)
if b == 1 then
game.Workspace.Sound2:Play()
elseif b == 2 then
game.Workspace.Sound1:Play()
end
end
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