|
| 15 Sep 2015 11:08 AM |
How would I do this?
--ModuleScript func = function() return false wait(10) return true end
--Script local mod = require(ModuleScript) mod() repeat wait(1) until mod == true
Would that work? |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:09 AM |
| Test it to see if it works, and by the looks of it, it should work. |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:10 AM |
--ModuleScript func = function() return false wait(10) return true end return func -- very important
--Script local mod = require(ModuleScript) mod() repeat wait(1) until mod == true
--ThatChristianGuy |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:10 AM |
Also keep in mind that you can only have one return in a block, so the two returns in your function will error.
--ThatChristianGuy |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:11 AM |
Please guys. This will not work at all. You can't return two things. This won't work on a level that I won't even bother correcting any of you Dx |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:12 AM |
I mentioned that already Jarod.
--ThatChristianGuy |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:12 AM |
| I meant it'll run, what he's trying to do won't work. |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:12 AM |
You need to explicitly return something at the end of the ModuleScript. Act as if the entire script itself is an enclosed function.
ModuleScript: return "Hi!"
Script: print(require(ModuleScript)) --> Hi! |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:13 AM |
Scripterity, his script tries to call a nil value (mod).
--ThatChristianGuy |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:14 AM |
ThatChristianGuy, you didn't finish posting before I started.
"Scripterity, his script tries to call a nil value (mod)." But his script will still run, so Scripterity was correct. |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:15 AM |
Any script will run as long as it's not disabled.
--ThatChristianGuy |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:16 AM |
Not really.
Try running this script: (]+++=//*^%ne\52gt} That will be a syntax error, not a runtime error. |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:34 AM |
func = function() return false wait(10) return true end return func
--Script local mod = require(ModuleScript) mod() repeat wait(1) until mod == true
How can I make this work? |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2015 11:43 AM |
func = function() wait(10) return true end return func
--Script local mod = require(ModuleScript) mod() -- This waits ten seconds
How can I make this work? |
|
|
| Report Abuse |
|
|