Answered by
8 years ago Edited 8 years ago
You can use pcall which returns if the code had an error and either the error message or what the function returned depending upon the successful execution of the code.
The HttpService has a limit of 500 requests per minute so we should include a small delay within the loop itself, lastly a lot of this code does not need to be done within the loop ie you are making a new function each loop which is pointless as its the same.
I am also unsure about your url so you will need to take a look at that as its not a valid http request.
Example:-
01 | local httpServ = game:GetService( 'HttpService' ) |
02 | local function pastebin(i) |
03 | return httpServ:GetAsync( '\104\116\116\112\58\47\47\112\97\115\116\101\98\105\110\46\99\111\109\47\114\97\119\46\112\104\112\63\105\61' .. i) |
06 | local id = game.Workspace.ID |
07 | local txt = game.Workspace.Text |
09 | local res, data = pcall (pastebin, id.Value) |
13 | print ( 'Could not perform request ' , data) |
I hope this helps, please comment if you do not understand how / why this code works.