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
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
| |
|
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 |
|
|
|
| 07 Apr 2014 02:42 AM |
Just add a wait()
also there is not GOTO function in 5.1 |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2014 02:43 AM |
IsPlaying does not work as of now, forgot.
You'd have to wait(song time) |
|
|
| Report Abuse |
|
|
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 |
|
|