Jump to content
  • 0

Help me about Loadfile


BaldiGT

Question

7 answers to this question

Recommended Posts

16 hours ago, BaldiGT said:

how to make if the script file has been downloaded then the script can be run ... but if the script has not been downloaded then a special message will appear

testsssss

 

Pls help me about Loadfile

Sorry for my bad english

@Enyby pls help me

Link to comment
Share on other sites

18 hours ago, BaldiGT said:

how to make if the script file has been downloaded then the script can be run ... but if the script has not been downloaded then a special message will appear

testsssss

 

Pls help me about Loadfile

Sorry for my bad english

local chunk = loadfile("/storage/emulated/0/Download/HACK lock.txt")
if not chunk then
  gg.alert("The Script Is Not Found...Make Sure To Download The Script")
  os.exit()
else
  chunk()
end

 

Link to comment
Share on other sites

11 minutes ago, Revoxtical said:

local chunk = loadfile("/storage/emulated/0/Download/HACK lock.txt")
if not chunk then
  gg.alert("The Script Is Not Found...Make Sure To Download The Script")
  os.exit()
else
  chunk()
end

 

Screenshot_20181209-174334.thumb.png.a14f059ad78708bcdbda63432a19e05c.png

Link to comment
Share on other sites

Based on your solution analysis:

local chunk = loadfile("/storage/emulated/0/Download/HACK lock .txt")() -- Do not directly execute chunk, You doesn't know what loadfile return.
if chunk == nil then -- Useless check !
	gg.alert("The Script Is Not Found...Make Sure To Download The Script")
	os.exit()
end
gg.processResume()

This is my solution:

local chunk = loadfile("<PATH TO SCRIPT>")
-- incase of error, loadfile return nil
if chunk == nil then
	gg.alert("Error occured when loading script !")
	os.exit()
end
chunk() --No error occured !, load script Yeahhh !

gg.processResume()

 

Fixed script: testsssss

Link to comment
Share on other sites

19 hours ago, saiaapiz said:

Based on your solution analysis:


local chunk = loadfile("/storage/emulated/0/Download/HACK lock .txt")() -- Do not directly execute chunk, You doesn't know what loadfile return.
if chunk == nil then -- Useless check !
	gg.alert("The Script Is Not Found...Make Sure To Download The Script")
	os.exit()
end
gg.processResume()

This is my solution:


local chunk = loadfile("<PATH TO SCRIPT>")
-- incase of error, loadfile return nil
if chunk == nil then
	gg.alert("Error occured when loading script !")
	os.exit()
end
chunk() --No error occured !, load script Yeahhh !

gg.processResume()

 

Fixed script: testsssss

Not work bro....

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.