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: I'm making a radio and there is a slight problem (Urgent)

Previous Thread :: Next Thread 
CalebMcBlockz is not online. CalebMcBlockz
Joined: 06 Jul 2011
Total Posts: 996
04 Dec 2014 03:42 PM
I have the ScreenGUI and the music plays, All the audio is named JSong1, JSong2, JSong3, JSong4, JSong5.

The problem I have is that the audio will not stop playing when you press the off button, and here is the script so do I need to fix anything?

local Button = script.Parent

function onClicked()

JSong1:Stop()

function onClicked()

JSong2:Stop()

function onClicked()

JSong3:Stop()

function onClicked()

JSong4:Stop()

function onClicked()

JSong5:Stop()

end

Button.MouseButton1Click:connect(onClicked)

If I can get feedback quickly that would be greatly appreciated.
Report Abuse
CalebMcBlockz is not online. CalebMcBlockz
Joined: 06 Jul 2011
Total Posts: 996
04 Dec 2014 03:44 PM
bump
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
04 Dec 2014 03:52 PM
I suggest you read up on functions and events. First off you are missing 4 ends. The output would have flagged this. Second you are writing to the same function variable 5 times. That's like doing this
x = 1
x = 2
x = 3
x = 4
x = 5
and expecting print(x) to print
1 2 3 4 5
Incase it's not clear it will only print 5.


--corrected code.

local Button = script.Parent

function onClicked()

JSong1:Stop()
JSong2:Stop()
JSong3:Stop()
JSong4:Stop()
JSong5:Stop()

end

Button.MouseButton1Click:connect(onClicked)
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