Reparenting script to ServerStorage with active task.delay thread "stops" the thread

I have been using an OOP-based approach to tracking player character events and actions, that makes use of individual task.delay threads to end these character statuses when their duration expires. But due to the way that the backpack in-game is set up, a tool that is parented to ServerStorage before the statuses that its scripts create expire has it’s task.delay threads “stop”. This causes these statuses to permanently stay active, and never expire unless outside intervention is used. What would be a viable workaround to this issue? Is there a way to have these task.delay threads active even with the script parented to ServerStorage? Thanks!

I don’t think so because scripts can’t run in server storage in general.

I guess you could change the way your code works to make it not go into server storage or have it stored in serverscriptservice which is where server scripts can run.

I think I found a simple workaround, which is to create a bindable, and a listener for it within CharacterScripts that will carry out the creation of the character status objects (and the accompanying task.delay threads)

Thanks for the help!

1 Like

Yea thats a good idea. Did not think of that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.