task.defer stops executing the passed function after some amount of time in live servers.
This issue has affected Pilfering Pirates. In this game there is a lot of destruction and I use task.defer to destroy any basepart joints that need to be destroyed at once. At some point the servers will just stop destroying joints.
The first report I received of this issue was Nov 14, 2024 | 2:06 AM (GMT)
Getting this issue too, running anything in a task.defer(function() just simply does not run. For me this happens in both live servers and studio sessions.
Edit: Trying to make a repro of this, not sure what causes this exactly because just running a simply script does work so a real head scratcher rn.
Edit #2:
I unfortunately canât find a way to make a repro even though this happens immediately and consistently 100% of the time at this current experience.
I got a report on this at around November 14 7pm EST and after the report the gameâs ragdoll is completely broken as the clean up runs in task.defer. What happens now is that things donât respawn when they should.
I canât make a repro because if I take this script alone in a different place it runs but it will not run in that studio and it wonât run in live servers, not sure what is going on.
If youâre still having this issue just copy and paste your game into a new studio and itâll fix the problem. Even after setting all of the property settings in workspace, lighting, material, textchatservice, etc to the same configurations you have in the game it wonât cause that issue to happen again. Gonna edit this post with a bug repro on late saturday or sunday.
I made a reproduction that reproduces this task.defer bug consistently. Just reset your character and look at the short HandleRagdoll script and youâll notice that âTHIS WILL NOT PRINTâ wonât print. This will happen both ingame and studio, this bug doesnât happen in all games and presumably (?) only happens in older experiences/studios that uses task.defer.
Like I noted earlier this started happening at around November 14 7pm EST. Hope this helps.
elseif child:IsA("BaseScript") or child:IsA("Script") or child:IsA("LocalScript") then
if not ScriptsToAvoid[child.Name] then
child:Destroy()
end
Youâre destroying the "Ragdoll" script under the character that requires your module, causing the thread to terminate after it yields. Thatâs why everything runs expect the task.defer.
Please double-check that your repros arenât flawed before posting.
We canât repro this bug, so weâre going to assume the issue is no longer occurring. If there are any additional details you can provide to help narrow it down that would be helpful! Thanks for the report!
this isnât a bug, your main ragdoll script gets deleted as soon as you die, so the deferred thread never initiates, whereas something like task.spawn will allow print but not actually do anything else because⌠the initial activation script gets deleted so the wait code never shall run to âloadcharacterâ