Jump to content
  • 0

How to make one time download only on lua script??


Question

Recommended Posts

  • 0
Posted

How can I stop the pop-up notification after a file has completely downloaded in Lua? The file is already in place and ready to execute, so the pop-up is unnecessary. Any tips on how to remove it? Thanks in advance!

  • 0
Posted
4 hours ago, 8ballpool12 said:

How can I stop the pop-up notification after a file has completely downloaded in Lua? The file is already in place and ready to execute, so the pop-up is unnecessary. Any tips on how to remove it? Thanks in advance!

local gg = gg

local FILE_PATH = "some_file.lua" -- Relative or absolute path

local function fileExist(filename)
  local f, err = io.open(filename, "r")
  if (f) then
    f:close()
    return true
  else
    return false, err
  end
end

local isScriptDownloaded = fileExist(FILE_PATH)

if (isScriptDownloaded) then
  print ("Script exist")
else
  print ("Script does not exist")
end

-- Alt way of doing

if (fileExist(FILE_PATH)) then
  dofile(FILE_PATH)
else
  -- download here
end

 

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...

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.