Jump to content
  • 0

Filter out files and putting the automatically into a gg.choice()


YeetMeister

Question

3 answers to this question

Recommended Posts

9 minutes ago, Enyby said:

Check name of choose file. If not match, return back yo choose.

Use loop for this,

Thank you, I will add that later. Can you help me? Idk why this isn't working

function select(A)
menu = gg.prompt({
	"select world file [["..ext.."]]",
	"select world name"
}, {dPath, " "}, {"file", "text"})
if menu[1]
  then
    file = io.open(menu[1], "r")
    source_content =
    file:read("*a")
    file =
    io.open(tPath..menu[2], "w")
    file:write(file)
  end
end

 

[added 2 minutes later]
4 minutes ago, YeetMeister said:

Thank you, I will add that later. Can you help me? Idk why this isn't working


local ext = ".wld"
function select(A)
menu = gg.prompt({
	"select world file [["..ext.."]]",
	"select world name"
}, {dPath, " "}, {"file", "text"})
if menu[1]
  then
    file = io.open(menu[1], "r")
    source_content =
    file:read("*a")
    file =
    io.open(tPath..menu[2], "w")
    file:write(source_content)
  end
end

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.