Scriptmanager state creation and thread creation