Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I send messages to and from roblox?

Asked by 3 years ago

So I don't know how I would do this but I want to: A) make a script that once someone stands on a part then it changes their role in my ROBLOX group. or B) make a script that messages me somehow preferably on ROBLOX that a player wants to change to another role in my group and then i manually change their role.

Please help tell me if anything is not possible or if it is how I would do it I am very limited in scripting so any help is appreciated thanks.

0
I do not think that is possible, but you can use webhooks and alternate apps like Discord (13+). Here is a devforum about it: https://devforum.roblox.com/t/discord-webhooks-integrating-roblox-with-discord/458366 Omq_ItzJasmin 666 — 3y
0
@Omq_itzJasmin Would it be possible to let them make a message as said before but make it save so that once one of the players in two certain ranks on my group which will be me and my friend ranks come on to the game it would show a popup only on their screen that shows the messages that has been send? UNIMAKZIN00 41 — 3y

1 answer

Log in to vote
1
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

For option A, this is possible but it requires you to have the ability to host an external server. Roblox provides APIs that allows you to communicate with the platform as a whole that you can manipulate with a web server. You can download node.js for building the basis of the web server and you can build the app yourself Express to handle the actual web server and Axios for providing a client that handles HTTP requests. Alternatively, you can look into noblox.js, which is a wrapper that allows you to communicate with Roblox's API, or possibly open-source auto-rankers.

I personally don't use noblox.js, so here's what I do to handle it on the external server by myself. You'd also have to make your server in a way that it accepts the player's userId as a parameter, perhaps as a query, i.e: the ?name=value in URLS, path (for example: https://scriptinghelpers.org/questions/121661. "questions" and "121661" are paths), or request body

  • Obtain your .ROBLOSECURITY cookie: you can search google to find how to get this
  • Send a HTTP POST request to https://auth.roblox.com/v2/logout with the Set-Cookie header set as .ROBLOSECURITY = your found cookie. This endpoint returns a X-CSRF-TOKEN in the response headers: very important header here
  • Head to this page and enter your group id in the groupId parameter in the parameter list below and click "Try it out!". The page will make a request to the endpoint and the response body will be shown below. Take the id of the role that corresponds to the necessary role name you want the user to be changed to.
  • Send a HTTP PATCH request to https://groups.roblox.com/v1/groups/{your_group_id_here}/users/{user's id here}. In the request body, set it to {"roleId": paste the role id of the role you found here}. In the headers, set the Cookie header to .ROBLOSECURITY = your cookie here; X-CSRF-TOKEN = the x-csrf-token you got from the authentication endpoint. If you've done everything right, the user's role should be updated

If you're not gonna bother with that, you can go with plan B, which is also possible, and use webhooks that sends the player's name. You can't be dmed by a webhook, but you can make a reserved channel for the game to send messages as requests to change a player's role. Check this out

0
I would like to do A @Rare_tendo but i have no idea what to do because my scripting knowledge is zero i know my group id is 9830479 but other than that i have no idea my group is called Talls and Smols https://www.roblox.com/groups/9830479/talls-and-smols#!/about if you could make a script and then like annotate it so i know how to use it could you do that please? UNIMAKZIN00 41 — 3y
Ad

Answer this question