SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
two loops to run at the same time
I tried
Spawn(function()
end)
coroutine.resume(coroutine.create(function()
end))
??? |
|
sbk28Join Date: 2008-11-15 Post Count: 2528 |
coroutine.wrap(function()
code1
end)()
coroutine.wrap(function()
dode2
end)() |
|
lordramboJoin Date: 2009-06-16 Post Count: 20628 |
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. |
|
|
wouldn't
for i = 1,2 do
--whatever
wait()
end
work? |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
It worked now, thanks. |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
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)() |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
eLunateJoin Date: 2014-07-29 Post Count: 13268 |
It's the camera that's the problem, right? Localscript. |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
It's in a localscript :/ |
|
eLunateJoin Date: 2014-07-29 Post Count: 13268 |
Damn. Well, I've not touched the camera yet so I'm out of ideas.
|
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
lordramboJoin Date: 2009-06-16 Post Count: 20628 |
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. |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
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". |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump, works in solo, not play. |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
help qq |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
hi |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
SerGregorJoin Date: 2010-07-17 Post Count: 7957 |
bump |
|
|