Using webhook for saving builds?

I have a feature in my game that compresses a build into a string that can be loaded, but it has some holdbacks:
there is a pretty restrictive character limit
its easy to copy the text wrong
showing the entire raw text is overwhelming to new players
saving a build over the character limit is unloadable, many people have lost builds due to this

So i though, would it be possible to use a webhook to send data to a sort of database which attributes data to a name/ID? You basically just press save, it sends the data to the database with a generated ID, you get the ID, then you just paste in the short id to get your build.

This in concept sounds simple, but in execution im struggling to find the tools to do this. Is it possible to retrieve data through a discord webhook? is the ID system even the smartest way to go about it? Would data have a lifetime? would it be too slow? What could possibly fail in the process that needs compensating for? Lotta questions.

All i really need to know is what the best tools to do this would be. Not at all looking for someone to just send over code for me to ctrl+v into my game. The documentation for the httpservice seems to mention pastebin or httpbin, though i cant figure out if either can do what i want it to. I’ve made several discord/roblox webhooks before but they are all one-sided, meaning you just send data, you dont retrieve anything.

Main reason I need the data to be easily sent around in a simple format like text is so that its more community driven. I like letting people trade around and showcase builds others can just simply load with a click. I’ve also allowed people to build things for a randomly generated map system for PvP mode and thats been great. I can’t do any of that with a system that requires the person who saved the data to load it.

what you’d need is a combination of http service + your own server with API endpoints as well as a database too. if you’re new to these concepts, it’d take a little while to learn the tooling properly, so for now I suggest using datastore service and just enforcing a limit on player builds

does datastores work

key = {string = jbHNmxX, data = yourStringData}

if they have a character limit then probably not possible.

although if you’re importing the builds throughout expeirences and from third-party stuff, it may genuinely not be possible do you have to use a webhook. (I don’t have expirence in those)

It sounds possible, but as far as I know, not many games do this. You should take a look at how you are compressing your build string, as the limit is quite large, so I don’t know how you have reached it so easily. I’ve compressed large builds in building systems without reaching near the limit.

There isn’t too much data per part to store, only it’s cframe, size, color, material etc. Also, if you have non-customised objects in your system, to save space, perhaps just store the object in ReplicatedStorage and only save the part’s name and position, so when you load in, you can just clone the stored object and move it to where necessary.

Here are the limits for datastores:

Alternatively, if this is still somehow not enough, perhaps create an overflow key and assign new data to it when your original key is at the limit (use string.len to find your key data amount, as said in the article)

I can’t help you that much if you really do want to use off-site data storing, but I have used PasteBin before for storing tweet codes. I’m sure there will be a way you can set and retrieve data through there, just look on YouTube. Another option is using a service like MongoDB, but you might end up paying a bit of money and it sounds unnecessary just for a building system.

2 Likes

Do not use discord for this, I don’t think it’s possible anyway, but if you do, discord will hate you
(Discord blocked webhooks from roblox servers because of people sending, mildly abusing it with log data, don’t know if they still block them)

Why can’t you use roblox’s datastores for this? Is it because of the sharing thing…? Not quite sure what you are trying to achieve, or why you need to store it in an external database. If you want players to be able to get other player’s builds, you can let them access another player’s datastore

1 Like

Do not use Discord webhooks for this, not only does Discord hate this like others have mentioned, the ratelimit is per-resource (per-webhook), meaning you can only send about 5 requests every second across an entire experience, you’ll also only have 2000 characters to work with in content, and a few extra thousand if you include embeds.

Why not just use DataStores?
It’ll also allow you to moderate builds easier because they can’t just be copied around as a text string.

1 Like