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
 

One way button, being a poop!

Previous Thread :: Next Thread 
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
17 Mar 2014 02:14 PM
Pauses music, but when pressed again, the music doesn't play again!! Please help, here is the script:

sound = script.Parent.Parent.SoundBlock.Boom
sounda = script.Parent.Parent.SoundBlocka.Boom

function onClicked()
if sound.IsPlaying == true then
sound:Pause()
sounda:Pause()
else if
sound.IsPlaying == false then
sound:Play()
sounda:Play()
end
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
17 Mar 2014 02:16 PM
Try instead:

if sound.IsPaused == false then

Report Abuse
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
17 Mar 2014 02:59 PM
sound.IsPlaying = not sound.IsPlaying
Report Abuse
Techante is not online. Techante
Joined: 17 Oct 2011
Total Posts: 2101
18 Mar 2014 03:24 AM
Ok then, I will try that.
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
18 Mar 2014 03:27 AM
elseif not else if
it makes a difference
Report Abuse
wubbzy301 is not online. wubbzy301
Joined: 15 May 2010
Total Posts: 1188
18 Mar 2014 03:57 AM
sound = script.Parent.Parent.SoundBlock.Boom
sounda = script.Parent.Parent.SoundBlocka.Boom

function onClicked()
if sound.IsPlaying == true then
sound:Pause()
sounda:Pause()
elseif sound.IsPlaying == false then -- it must be fixed.
sound:Play()
sounda:Play()
end
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
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