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: How do I return to a line?

Previous Thread :: Next Thread 
xXLiLxJXx is not online. xXLiLxJXx
Joined: 15 Mar 2012
Total Posts: 687
07 Apr 2014 01:42 AM
How can I make a script return to a line once an action is finished?
I am not looking for a while true do thing, I want to return to a specific line once a specific action is called.
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
07 Apr 2014 01:54 AM
Its called a function
Report Abuse
xXLiLxJXx is not online. xXLiLxJXx
Joined: 15 Mar 2012
Total Posts: 687
07 Apr 2014 02:09 AM
Functions are for calling, I want it to go back to a line and restart from there.
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
07 Apr 2014 02:12 AM
put the section of code you want to go back to as a function.
Report Abuse
xXLiLxJXx is not online. xXLiLxJXx
Joined: 15 Mar 2012
Total Posts: 687
07 Apr 2014 02:18 AM
I did, but it doesn't seem to run on from that. I am trying to make a script that auto changes when the song ends. Can you view the script and fix what you see?

wait(4)

Song1 = "http://www.roblox.com/asset/?id=131530515"
Song2 = "http://www.roblox.com/asset/?id=131312799"

--Song1 = "http://www.roblox.com/asset/?id=151041289"
--Song2 = "http://www.roblox.com/asset/?id=151040291"

function Music()
if script.Tunes.SoundId == Song1 then
script.Tunes.SoundId = Song2
elseif script.Tunes.SoundId == Song2 then
script.Tunes.SoundId = Song1
end
end


wait(1)

while true do
if script.Tunes.IsPlaying == false then
script.Tunes:Play()
Music()
end
end


Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
07 Apr 2014 02:20 AM
NO WAIT() = CRASH
Report Abuse
xXLiLxJXx is not online. xXLiLxJXx
Joined: 15 Mar 2012
Total Posts: 687
07 Apr 2014 02:23 AM
I never crashed :l
It only crashed when I put it inside the if statements.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
07 Apr 2014 02:42 AM
Just add a wait()

also there is not GOTO function in 5.1
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
07 Apr 2014 02:43 AM
IsPlaying does not work as of now, forgot.

You'd have to wait(song time)
Report Abuse
xXLiLxJXx is not online. xXLiLxJXx
Joined: 15 Mar 2012
Total Posts: 687
07 Apr 2014 02:59 AM
When you say "IsPlaying does not work as of now", you mean it is only temporary?
Like it will be fixed eventually? I can't believe I wasted about 2 hours trying to figure that thing out...
I guess I will use wait() again... Temporarily, till the IsPlaying fixes.
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