How to allow donators to pay exactly how much they want to pay

| Back to hub |


Before I made this project, you’d have to specify donation prices as a developer. However, I’ve been working on a project that’ll allow donators to choose how much they’re going to pay!

I’ve made an demo that’s accessable from my group page, the webserver I’ve made for this can’t be online 24/7 though, so before trying out my demo, make sure the webserver is “awake” by pinging it.

NOTE: This project currently only supports group games, and needs to log into an account that is allowed to create developer products in the group using their .ROBLOSECURITY cookie.


Set up your own webserver

To set up your own webserver, you’ll need to have the following installed:

The code for the webserver can be found here.
I’m not going into detail on how the code for the webserver works exactly. But there’s one thing you need to know about, in the file handler.js on line 5 it sets the cookie to the environment variable COOKIE. This should be modified to your .ROBLOSECURITY cookie.

Because this cookie is very sensitive I don’t recommend using your main account’s .ROBLOSECURITY cookie if you don’t trust me, but instead create an alt account and use it’s .ROBLOSECURITY cookie.

After you’ve done this, and possibly port forwarded if needed, you should be able to start the webserver by running node server.js in the terminal/command line. You’ll need to take note of your webserver’s IP address as you’ll need it when you set up your Roblox game.

Set up the Roblox game

Everything you need to set up your Roblox game for this project can be copied from the demo, which is uncopylocked.
There is one thing you need to change in order to make it function with your webserver, the hostname.

Inside of the only server-sided script in the game (the path is game.StarterGui.ScreenGui.Script) on line 6 it currently sets the hostname to http://roblox-donation-api.glitch.me/, however in your game this should be set to your own webserver’s IP address.

UPDATE: Today I updated this system, it now also allows you to:

  • Incorporate Roblox’s 30% taxes using the AddPossibleTaxes function.
  • Set a minimum and maximum amount of Robux to donate.

Next time I plan to make it purely Roblox, which means no more webserver would be needed.


Thanks for reading my tutorial, remember to please rate it and give me some feedback.

Please rate my tutorial
  • 1
  • 2
  • 3
  • 4
  • 5

0 voters

30 Likes

Im confused. Is there a asset we can get from the toolbox to get this in our game quickly? Good tutorial. :slight_smile:

2 Likes

Not at the moment, although I’m working on it

Yes, you can get the model here. It still requires the same modifications as you’d have to make when modifying the demo.

1 Like

This is pretty nice but, what are the limitations of this? (e.g. rate limits, etc)
Also, I’d think it’d be pretty nice if Roblox allowed developers to change the price of a developer product for specific players; this may be useful for discounts, etc.

Edit: I just tested it out in your test game; it’s amazing.

3 Likes

This is a really clever solution! My only concern is that an exploiter could create a million dev products by pinging the server with a for loop. Is it possible to protect against that?

1 Like

To be honest, I didn’t really think about rate limits myself. :sweat_smile: I’ll be busy with shool during the week, but I’ll work on rate limitations next weekend!

1 Like

I don’t think this is the best idea to do, first, creating a new developer product is time-consuming, and second, why would you spam your developer products page with hundreds of products that are occupying memory on roblox’s servers.

But gotta respect your work, looks very nice :slight_smile:

I already requested a feature, both for on website and using Roblox’s public API, to delete or archive unused developer products. I’m hoping to hear a response from them sometime soon.

2 Likes

If you play the demo, it’s actually really fast. Also, a few hundred dev products is the least of Roblox’s worries in terms of memory. There are large games that make a new copy of your data every time you play.

1 Like

By the way, if you go above a certain price, the dev product fails. I don’t know precisely what the maximum is but it’s greater than 2^46 and less than 2^47. It also fails if the number has a decimal.

image

1 Like

Thanks for telling me, I’ll also be fixing that next weekend.

1 Like

I have tested the gameplay and it took around 1 minute for the prompt to pop up

1 Like

That’d probably be because the webserver I used in my demo was “asleep”.
If you first “wake it up” by going to http://roblox-donation-api.glitch.me/ping, wait till it finishes “waking up”, and then try donating again it should be much faster.

1 Like

I want to thank everyone who has donated so far. Thanks to all you boys, girls, and enbies our group already earned almost double the amount of robux it already has. Thanks for all the donated robux! :heart:

1 Like

Your tutorial is great for people who already know how to set-up a web server, but it would be even better for those who don’t if you added on to your tutorial with instructions on how to set one up for those who don’t know!

Edit: for context I mean that you should show them how to use a service like glitch to set this up, not just tell them how to setup the system itself on one

2 Likes

So I take it that the server creates a dev product of the amount specified by the user and then it links with the game so that the user can then buy it.

Interesting way of going about it. Very innovative.

1 Like

Bump because I made a small update to this.

The donation doesn’t seem to be popping up.

The github page doesn’t seem to exist? Could you fix this?