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 » Scripters
Home Search
 

Re: Task scheduling?

Previous Thread :: Next Thread 
ASpoonfullOfSucrose is not online. ASpoonfullOfSucrose
Joined: 28 Oct 2015
Total Posts: 442
30 Jul 2016 11:16 AM
I'm stuck on a workaround to this issue. :C
Structure:

function one()
--things
end

function two()
--things
end

Function two calls function one, function one calls function two at a certain point.
You see my dilemma.
Function two technically doesn't exist yet for function one so it can't call it.
It's such a simple thing but it's bogged me down.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
30 Jul 2016 11:22 AM
Tag these functions and put the variables in a table. Call the function from the tag in that table.
I've never done the above, so I don't know if it's valid, but alternatively you could require the functions from a module script.
Report Abuse
ASpoonfullOfSucrose is not online. ASpoonfullOfSucrose
Joined: 28 Oct 2015
Total Posts: 442
30 Jul 2016 11:25 AM
Could you write a bit of script to show me how to do that?
(As far as I know I thought tables could only contain individual variables)
Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
30 Jul 2016 11:30 AM
You Could Do

wait(10)

one()

wait(5)

two()


Just Trying To Help Out! ~ TwoCoding
Report Abuse
TaskScheduler is not online. TaskScheduler
Joined: 14 May 2013
Total Posts: 497
30 Jul 2016 11:36 AM
while true do end
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
30 Jul 2016 11:38 AM
Yeah I'm pretty sure function1 can call function2 IF you call function1 after function.
Don't auote me but it sounds logical.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
30 Jul 2016 11:39 AM
Sorry on mobile keyboard :/
The last word should be function2*

and auote is quote*
Report Abuse
ASpoonfullOfSucrose is not online. ASpoonfullOfSucrose
Joined: 28 Oct 2015
Total Posts: 442
30 Jul 2016 11:57 AM
Yea, putting Function1 after Function2 would work, but due to other reasons that's not possible.
Report Abuse
ASpoonfullOfSucrose is not online. ASpoonfullOfSucrose
Joined: 28 Oct 2015
Total Posts: 442
30 Jul 2016 02:23 PM
Bump

I've been working on this but the solution still eludes me.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
30 Jul 2016 02:33 PM
local Function1, Function2 -- Declare both variables as nil to start.


Function1 = function()
Function2()
end

Function2 = function()
Function1()
end


I don't think that's even really necessary though. It may warn you that it isn't declared yet, but I think it should still work even if you don't do that step.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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