I wanted to know how to make a module script stop execution.
Example:
MODULE:
function module:WaitUntilAvailable()
while (not self.PMCRRC_Connection['Loaded']) or self.PMCRRC_Connection['Loaded']~=true do
if self.PMCRRC_Connection['AbortLoading'] then
ABORT_SCRIPT()
end
wait()
end
return true
end
SCRIPT:
local module =require(modulepath)
print("Start")
module:WaitUntilAvailable()
print('It should not print this if ABORT_CODE is executed.')
-- module
function module:WaitUntilAvailable()
while (not self.PMCRRC_Connection['Loaded']) or self.PMCRRC_Connection['Loaded']~=true do
if self.PMCRRC_Connection['AbortLoading'] then
return false
end
task.wait()
end
return true
end
-- script
local module =require(modulepath)
print("Start")
local yield = module:WaitUntilAvailable()
if yield then
print('It should not print this if ABORT_CODE is executed.')
end