YeetMeister Posted August 30, 2019 Share Posted August 30, 2019 Is it possible to filter out files with an Extension? Like if I have a .sss The script filters out any other extension and buts the .sss into a gg.choice() Link to comment Share on other sites More sharing options...
Administrators Enyby Posted August 30, 2019 Administrators Share Posted August 30, 2019 Check name of choose file. If not match, return back yo choose. Use loop for this, Link to comment Share on other sites More sharing options...
YeetMeister Posted August 30, 2019 Author Share Posted August 30, 2019 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 More sharing options...
Administrators Enyby Posted August 30, 2019 Administrators Share Posted August 30, 2019 Something like this: Examples of Lua scripts (#bwddvayx) Link to comment Share on other sites More sharing options...
Question
YeetMeister
Is it possible to filter out files with an Extension?
Like if I have a .sss
The script filters out any other extension and buts the .sss into a gg.choice()
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.