• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

RevScripts HTTP requests on TFS

Vills

Aldaroth Mapper
Joined
Aug 3, 2014
Messages
14
Reaction score
3
Location
Brazil - São Paulo
Hello, before creating this topic I searched everywhere for a topic that could help me. I need to create a way to make HTTP requests, with this I intend to create a system where the NPC provides a simulation of human conversation through the consumption of the ChatGPT API. I don't know how I'm going to build this, but for now an onUse function with the logic to make an HTTP request would help me a lot. I searched for threads where there was someone with a similar problem. Could someone help me by providing example code where an HTTP request takes place?
In advance I apologize for my bad English, I'm using a translator to communicate.
 
Lua:
local http = require('socket.http')
local result, status = http.request('http://www.google.com')
print(result) -- raw response
print(status) -- HTTP response status code

In case there is no lua socket on your system installed, try running sudo apt-get install lua-socket
 
Lua:
local http = require('socket.http')
local result, status = http.request('http://www.google.com')
print(result) -- raw response
print(status) -- HTTP response status code

In case there is no lua socket on your system installed, try running sudo apt-get install lua-socket

Won't it cause freeze/lag for players?
 
Hey, I have just created a thread that may help you on that!

 
Back
Top