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: I need

Previous Thread :: Next Thread 
Fedorakid is not online. 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 is not online. 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 is not online. 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
Meowcatmaster is not online. Meowcatmaster
Joined: 20 Oct 2012
Total Posts: 769
15 Nov 2014 03:12 PM
wouldn't
for i = 1,2 do
--whatever
wait()
end
work?
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
15 Nov 2014 03:12 PM
It worked now, thanks.
Report Abuse
Fedorakid is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
15 Nov 2014 06:02 PM
bump
Report Abuse
eLunate is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
15 Nov 2014 06:08 PM
It's in a localscript :/
Report Abuse
eLunate is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
15 Nov 2014 06:52 PM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
15 Nov 2014 07:14 PM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
15 Nov 2014 08:19 PM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
15 Nov 2014 08:40 PM
bump
Report Abuse
lordrambo is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 05:24 AM
bump
Report Abuse
Fedorakid is not online. 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 is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 06:08 AM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 07:52 AM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 08:29 AM
bump, works in solo, not play.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 09:44 AM
help qq
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 10:13 AM
hi
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 11:01 AM
bump
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
16 Nov 2014 11:40 AM
bump
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
16 Nov 2014 11:43 AM
Just use spawn(function)
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