To reproduce, open a fresh baseplate, ensure that Live Scripting is enabled, and run the following code in Roblox Studio’s command bar:
local myScript = Instance.new("Script")
myScript.Parent = workspace
game:GetService("ScriptEditorService"):UpdateSourceAsync(myScript, function()
return "Ok...\r\n"
end)
assert(myScript.Source == "")
After running this code, the following error message is repeatedly printed to the output:
Kicked from Live Scripting Session: Server received illegal atomic operation
Interestingly, after opening the script in the editor, the desired content is visible for a split second before vanishing.
This is a problem for Rojo because the majority of users are on Windows and their script files likely contain CRLF line endings. The software is unusable for them as long as Live Scripting is enabled.
Expected behavior
ScriptEditorService:UpdateSourceAsync
should be able to set script sources that contain CRLF line endings. If scripts only containing LF endings is a hard requirement, then it’d be acceptable for this API to replace any CRLF endings with LF endings, but I think parity with setting Script.Source
is the right move here. CRLF line endings also exist in the wild in Roblox’s Catalog, so Live Scripting should probably properly support them!