Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 15 Nov 2014 03:09 PM |
two loops to run at the same time
I tried
Spawn(function() end)
coroutine.resume(coroutine.create(function()
end))
??? |
|
|
| Report Abuse |
|
|
sbk28
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 2528 |
|
|
| 15 Nov 2014 03:10 PM |
coroutine.wrap(function() code1 end)()
coroutine.wrap(function() dode2 end)() |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 15 Nov 2014 03:11 PM |
coroutine.wrap(function() while true do print("x") wait(1) end)()
while true do print("y") wait(1) end
you don't have to put the second one in a new thread because it's not interfering with anything (at least not in this example) but you will want to if you have code beneath to two loops. |
|
|
| Report Abuse |
|
|
|
| 15 Nov 2014 03:12 PM |
wouldn't for i = 1,2 do --whatever wait() end work? |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 15 Nov 2014 05:43 PM |
It worked in play solo, not in play mode
coroutine.wrap(function() for i = game.Workspace.CurrentCamera.FieldOfView,55, -1.5 do wait() game.Workspace.CurrentCamera.FieldOfView = i end end)() coroutine.wrap(function() for i = 0.1,1.5,0.2 do wait() script.Parent.GripPos = Vector3.new(i,0,0) end end)() |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 15 Nov 2014 06:08 PM |
| It's the camera that's the problem, right? Localscript. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 15 Nov 2014 06:10 PM |
Damn. Well, I've not touched the camera yet so I'm out of ideas.
|
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 15 Nov 2014 11:08 PM |
Sorry if I came in a tad late :P You probably forgot to wait for the character at the top. Whenever something works in solo but not in online, it usually means you forgot to do that. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 16 Nov 2014 05:26 AM |
and this is the part that doesen't happen at the same time.
coroutine.wrap(function() for i = game.Workspace.CurrentCamera.FieldOfView,55, -1.5 do wait() game.Workspace.CurrentCamera.FieldOfView = i end end)() coroutine.wrap(function() for i = 0.1,1.5,0.2 do wait() script.Parent.GripPos = Vector3.new(i,0,0) end end)()
The camera changes smoothly, then when it is finished the Grip of my tool begins changing grip. It is in a localscript and this fires when you have done the following:
Equipping the tool Is in FPS mode Right click while in FPS mode
If you've guessed it already, it's a sight and I got the idea from a place made of "Arke". |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 16 Nov 2014 08:29 AM |
| bump, works in solo, not play. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
| |
|
| |
|