Is of now, it currently possible to export like a .txt file through roblox studio or is this not a thing? You can import a file but I don't think you can download/export. The closest thing you can do is export an obj file but I would have no idea how to decode an obj file.

ANSWER: So, I came up with a pretty good solution. What I did was I created a new script and changed it's code to whatever. Then I used selection service to select this script. Then I did plugin:PromptSaveSelection() This saves it as a .lua file which is basically the same as a .txt file.

function for it:

local Selection = game:GetService("Selection")

function SaveFile(text, filename)
	local Script = Instance.new("Script",game.Workspace)
	Script.Source = text
	Script.Name = "SaveFile"
	Selection:Set({Script})
	plugin:PromptSaveSelection(filename)
	Script:Remove()
end

SaveFile("lololol", "filename")

NOTE: this only works from a plugin or the command line. :))

To load the file you would have to do:

local studioservice = game:GetService("StudioService")
local file = studioservice:PromptImportFile({'lua'})

if file ~= nil then
	file = file:GetBinaryContents()
	print(file)
else
	print("Error loading file!")
end

--You can do whatever you want with the text you got from the file

2 comments

0

Could you share data cross-servers with this?

0

well game servers no but http servers then.. maybe?