This project consists of an API developed with Flask and Python that allows you to connect an external database to Roblox games. In this case we will use MongoDB but you can use any other database you want.
NOTE THIS PROJECT IS FOR LEARNING PURPOSES ONLY. DO NOT USE IT IN PRODUCTION. SECURITY IS LOW, AND ANYONE CAN MANIPULATE IT.
You will find the SOURCE in my GitHub repository.
Connecting an EXTERNAL Database to your ROBLOX GAME
Using the ModuleScript that is in the GitHub repository we will require it in a Script like this:
local HttpService = game:GetService(“HttpService”)
local HttpMethodsService = require('Here we refer the Module Script')
Now this is how we will use the ModuleScript:
-- GET: Retrieve user data from MongoDB
local UserId = 111
HttpMethodsService.GetUsersFromMongoDB(UserId)
-- POST: Add user information to the database
local PostInformationFromUser = {
user_id = 123456789,
}
HttpMethodsService.addUserToMongoDB(PostInformationFromUser)
-- PUT: Update the user's information in the database
local UserIdToUpdate = 692194040
local newPutDataFromUser = {
Money = 1000,
Cars = 231123
}
HttpMethodsService.updateUserInMongoDB(UserIdToUpdate, newPutDataFromUser).
So now we know how to Connect a Database to your ROBLOX GAME.
If you have any questions or you think there is something wrong that I should change, here is my discord user: fkooo.
It’s my first time to make a post both on GitHub and here, so I accept constructive criticism!