Jump to content
  • 0

gg.makeRequest not working


TopSecret5478

Question

2 answers to this question

Recommended Posts

Printing doesn't execute stuff you are just printing the function if you want to make a script with pastebin just make an account on there and make your paste make sure its lua code.

once you are done putting code in the paste . save the paste and go to the raw link. above the search bar copy that link then

do the following here:

--GameGuardian makes a internet request
local API = gg.makeRequest("paste bin raw link").content

--Checks if you granted access. if true then it will procceed to load the code inside of the pastebin
if API then
  pcall(load(API))
 else
  gg["alert"]("Error You have not granted internet access!")
  os.exit()
end

Just a little note you don't have to write your functions in  bracket notation you can always use regular gg.alert() they both work 

Link to comment
Share on other sites

I have recently created this function

local function Prequest(url, data)
  local result = gg.makeRequest(url, nil, data).content
  if not result then
    gg.alert("HTTP request failed, please make sure you are connected to internet and allow connection to the script.")
  end
  return result
end

-- Call the function without data
local test = Prequest("https://pastbin.com/hAUUYayh")

-- Call function with data
local test = Prequest("https://pastbin.com/HSHsbbsh", "Hello World !")

Headers are rarely used so i just ignored that, if you want you can add the param. for the header

Prequest stand for : Protected Request

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.