Jump to content
Fathoni267

Rename file

Recommended Posts

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

 

Share this post


Link to post
Share on other sites

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 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...