Jump to content
We are investigating issues where accounts became locked on login attempt #1. Lock feature disabled for now. ×

gg.makeRequest not working


 Share

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

Edited by MAARS
Link to comment
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
 Share

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