What do you want to achieve?
I would like to connect a website that I have to my Roblox game. The goal is that when you press the button on the website, whatever info that was entered in the textbox on the website will print in the Roblox game’s console.
What is the issue? Include screenshots / videos if possible!
I don’t have any idea on how to achieve this. I have experimented with other http calls before, but have not tested this on a website I own.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have searched the whole web, but there isn’t a direct approach to what I am trying to achieve. I found a similar post by Roblox user " buswssnoobpro" but he did not explain his process.
I am not asking for an entire system to be created. I am asking for more of a guide on what I should do, such as a list of the steps I need to take to achieve this. Thank you!
For this scenario, you need to use HttpService, which can get and send data to and from your website. To do this, you need to ensure that Http Requests are enabled in your games settings. To send data to your website, you need to encode and decode the data using :JSONDecode(), and :JSONEncode().
To send data, you could either use :RequestAsync(), setting its second parameter to POST, or :PostAsync(), which does the same thing. To receive data, you could also use :RequestAsync(), setting the second parameter to GET, or using its dedicated function :SetAsync(). Be aware that you need to send data back on your website for :RequestAsync() to work.
This is unhelpful. If you read OP’s original request is that he wants to listen for requests so that when the initiator, the user on a website presses a button, that data is sent to Roblox.
@IsaiahCoolKidYo there is no proper implementation to listen for http requests on the roblox end as there is also no endpoint for each roblox game. You’ll need to look into long polling.