Search code examples
htmlluawebserverrobloxhttpservice

How to use Roblox HttpService to connect to a webserver?


How can i connect to a webserver with Roblox HttpService and have a textbox and button on there so i can execute commands over the website and Roblox returns "Action Successful" or "Action Failed"


Solution

  • how to send a command from the webserver?

    The client has to actively get that command from the server. A client sends a request, a server sends a response. That's the principle of HTTP.

    Also the Roblox documentation says in the first line:

    This service allows HTTP requests to be sent FROM game servers.

    Your game server is the HTTP client.

    Polling the HTTP server for new instructions is the only way to get a command from a remote server.

    How can i connect to a webserver with Roblox HttpService and have a textbox and button on there so i can execute commands over the website and Roblox returns "Action Successful" or "Action Failed"

    You host a website with that input form on that server. When the button is clicked you store that information on the server and when your Roblox client polls that information you provide it.

    Please understand that I cannot explain the whole process in detail as it would require me to write a book or two. There are plenty of tutorials and books on HTTP, webhosting, HTML and sucht. The roblox part is well covered by the manual with its examples.