local mod = require(game.ReplicatedStorage.ModuleScript)
mod:Start()
task.wait(1)
script:Destroy()
local module = {}
function module:Start()
task.spawn(function()
while true do
print(1)
task.wait()
end
end)
end
return module
The prints in the while loop stop printing once the localscript has been destroyed. How can I keep the while loop going? I need this all stored in a function in the module, and I NEED the localscript to be destroyed, no compromises.
Would cloning the script and destroying the old one be feasible? Roblox recently changed the behavior of scripts such that infinitely looping code is terminated upon the script’s deletion.