KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:17 PM |
like this
while true do if script.Parent.Transparency = 1 then h = Instance.new ("Hint",Game.Workspace) h.Text = "hi" h.Name = "i guess a hint" end end while true do if game.Workspace['i guess a hint'] then script.Parent.Transparency = 0 end end
not saying i would use this script, just asking if its possible |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 08 Dec 2013 03:18 PM |
will never be necessary, and will crash the best of computers
don't do it |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:18 PM |
coroutine.resume(coroutine.create(function() --script end)) |
|
|
| Report Abuse |
|
|
FootBa11
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 11501 |
|
|
| 08 Dec 2013 03:18 PM |
Yes, but the second would never fire.
Try using coroutines. |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:19 PM |
| It's two separate loops and they are ended properly, so yes. <_< |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 08 Dec 2013 03:20 PM |
| ^ But the loop never breaks meaning the script will not continue to the next code unless you use a coroutine. |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:20 PM |
@GG, Nope, First loop would hog all the attention.
coroutine.resume(coroutine.create(function() --Loop one end)) --Loop two |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:23 PM |
so..... it would be like this?
while true do --stuff end coroutine.resume(coroutine.create(function() --stuff end))
it would do both? |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:24 PM |
| lol, didnt see lampwnage's post, :D |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:24 PM |
Nope. coroutine goes first. If it doesn`t get to the coroutine there is no way for it to run. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:26 PM |
basically a coroutine.resume(coroutine.create(function() is a loop that lets u loop more than once?
|
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:27 PM |
No A coroutine just allows you to do multiple things at once Example:
coroutine.resume(coroutine.create(function() wait(34234) end)) print("Hi")
------------ That will print instantly. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:30 PM |
question: how would i end that second one? Did u forget an end? Or is it supposed to be like that? coroutine.resume(coroutine.create(function() --Loop one end)) --Loop two |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:32 PM |
| The end is for the function, The two parenthesis end the coroutine.create( and coroutine.resume( |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:36 PM |
Say I had a function
player.Chatted:connect(function(msg) if msg == "hi" then player:Kick() end)
coroutine.resume(coroutine.create(function() if game.Workspace['Win message'] then print ("o yes") end end))
Would it only lead to that if someone Chats , or would it skip to it?
|
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:39 PM |
player.Chatted:connect(function(msg) if msg == "hi" then player:Kick() end)
Since that is triggered by an event, after it is done reading it, it wont hog all the attention.
coroutine.resume(coroutine.create(function() if game.Workspace['Win message'] then print ("o yes") end end))
That coroutine isn`t really needed here.
|
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:39 PM |
Ok, heres what im trying to say:
Will the couritine not interfere with the script, like if i put it at the start, would it prevent everything from starting? |
|
|
| Report Abuse |
|
|
|
| 08 Dec 2013 03:44 PM |
Coroutines pretty much pretend as if the code between them are not actually there while still executing it.
Here`s another example: coroutine.resume(coroutine.create(function() while wait(1) do print("This will print") end end))
while wait(1) do print("This will also print") end
print("This will not print")
|
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 08 Dec 2013 03:46 PM |
| epicccc so it doeen't interfere?!?!!?!? GREAT! |
|
|
| Report Abuse |
|
|