Skip to content

Instantly share code, notes, and snippets.

@aimbot6120
Created May 14, 2024 13:09
Show Gist options
  • Save aimbot6120/2176837c99ec7acabea8eb8bf3f1160d to your computer and use it in GitHub Desktop.
Save aimbot6120/2176837c99ec7acabea8eb8bf3f1160d to your computer and use it in GitHub Desktop.
Using XGaming quest API in lua. Visit xgaming.club
local function callQuestGeneratorAPI()
local url = "https://authdev.xgaming.club/xquest/generate"
local data =
{
goal = "",
key = "abcd1234",
fields = {
},
n = 1,
story = ""
}
local jsonData = HttpService:JSONEncode(data)
print("Loaidng Quest")
local headers = {
["Content-Type"] = "application/json"
}
local response = HttpService:RequestAsync({
Url = url,
Method = "POST",
Headers = headers,
Body = jsonData
})
if response.Success then
local responseBody = HttpService:JSONDecode(response.Body)
print(responseBody)
return responseBody
else
warn("Failed to call API: " .. response.StatusCode .. " - " .. response.StatusMessage)
return nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment