Intro:
Hey all! It’s been a while since I’ve posted a resource to the public. This module is pretty simple currently but can help new developers getting started with monetizing their games. This module uses an auto-updater in the event of bugs but you can fork this if you’re concerned about game security. I made this in about two hours because I need it for new games in the future but I decided to release it because I have literally nothing to lose.
This module allows you to add functions to gamepasses & developer products much more quickly if you didn’t already have a system built for your game by connecting them to events. You can even add it using a single line of code!
Events:
- premiumPlayerJoined
- onDeveloperProductPurchase
- gamepassPurchased
- gamepassOwned
Documentation:
- premiumPlayerJoined
This event will be called whenever a premium player is found in the game. This does not need to be added when the game starts as it’ll go through all of the existing players when you first link it. It’ll also fire when a user buys premium ingame or online. This function will always be called with a player linked to it.
local marketplace = require(7268166176)
marketplace.premiumPlayerJoined:Connect(function(player)
print(player,"has premium!")
end)
- onDeveloperProductPurchase
This event will fire with the player and the “receipt” whenever someone in your game buys the specified developer product.
A receipt is structured like this (as an example)
{
currencyType = "Robux", --> This value *probably* won't change.
placeIdWherePurchased = 1234567890,
playerId = 1,
productId = 123456,
purchaseId = "4266bf8d3dc65bc84fd3badf2edfdbe7"
}
developerProductId <int>
local marketplace = require(7268166176)
marketplace.onDeveloperProductPurchase(123456):Connect(function(player,receipt)
print(player,"bought an epic gamer product!")
end)
- gamepassPurchased
This event is fired whenever someone buys the specified gamepass ingame and does not check if they own it when they join the game (the next event does this).
gamepassId <int>
local marketplace = require(7268166176)
marketplace.gamepassPurchased(12345678):Connect(function(player)
print(player,"bought the VIP gamepass!!!! :ooo")
end)
- gamepassOwned
This event is similar to the premium one. It will automatically fire whenever someone in the game already owns the specified gamepass. It will also fire when they purchase it ingame. Each time it is connected, it’ll check all the players.
gamepassId <int>
local marketplace = require(7268166176)
marketplace.gamepassOwned(123456):Connect(function(player)
print(player,"now owns vip")
end)
More information:
- The module’s source code can be found here.
- I’d recommend using the require function in the event there are bugs, but if you’re worried about security issues feel free to fork it!
If you have any issues with this module, report it to me & happy developing!
- Yes
- No
0 voters
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
0 voters
My other public resources: