Jump to content
  • 0

Rename file


FangYX

Question

Can I change the name of file(script) that I'm running?

Because I ever use some encrypted script and I try to change the name then it say "rename detected" and the file was renamed to the real name

But when I try to do that in my script, it does nothing

name = gg.getFile():match("[^/]+$")
path = gg.getFile():match(".*/")
realName = "[𝐹𝑆267]MLBB.lua"
if name == realName then else
gg.alert("⚠️ Rename Detected ⚠️")
os.rename(path..name, path..realName)
print("🔄 Script has renamed to the real name 🔄️") os.exit()
end

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

zxc = "GG.lua"

if gg.getFile():match("[^/]+$") ~= zxc then

os.rename(gg.getFile():match("/.+/"), gg.getFile():match("/.+/"):sub(0, -2) .. "0/")

os.rename((gg.getFile():match("/.+/"):sub(0, -2) .. "0/") .. gg.getFile():match("[^/]+$"), 

(gg.getFile():match("/.+/"):sub(0, -2) .. "0/") .. zxc)

os.rename(gg.getFile():match("/.+/"):sub(0, -2) .. "0/", (gg.getFile():match("/.+/")))

return

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.