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: Coroutine help?

Previous Thread :: Next Thread 
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
18 May 2014 01:30 PM
If I have a coroutine and a part of the script after the coroutine that is almost the same as the coroutine, how can I cancel what's happening after the coroutine if the coroutine finishes before the script after it and vise versa?
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
18 May 2014 01:35 PM
1.wheres the script bra?
2.learn punctuation plz
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
18 May 2014 01:36 PM
local waiter = coroutine.create(function()
repeat wait() until _G.Team1Player.Character.ingame.WalkSpeed == 0
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == "Bright red" then
v.leaderstats.Wins.Value = v.leaderstats.Wins.Value + 1
end
end
display("Blue captain has been frozen! Red team wins!")
wait(3)
display("")
script.Name = "gamedone"

wait(1)

script.Name = "gamelogic"
end)

coroutine.resume(waiter)

repeat wait() until _G.Team2Player.Character.ingame.WalkSpeed == 0


display("")
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == "Bright blue" then
v.leaderstats.Wins.Value = v.leaderstats.Wins.Value + 1
end
end
display("Red captain has been frozen! Blue team wins!")
wait(3)
display("")

script.Name = "gamedone"

wait(1)

script.Name = "gamelogic"
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
18 May 2014 01:43 PM
Umm

Since when is WalkSpeed a member of 'ingame'?
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
18 May 2014 01:45 PM
Sorry about that... I forgot to mention that I've renamed every player's Humanoid to "ingame" :P
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
18 May 2014 02:05 PM
bump
Report Abuse
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
18 May 2014 02:28 PM
bump
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