Created by ScriptTops for free public domain use.
GamepassLib (GL)
Advantages of GL
GL does not require the user to reload the game to get the benefits of the gamepass,
GL is modular and uses OOP to handle gamepasses and devproducts,
and GL offers a easy to use Lib.
How to use GL
note: gl does offer more indepth documentation in the model
example gamepass
gamepassClass.new("Test", 10048580,{
--called upon buying
onBuy = function(player)
print("Thx for buying")
end,
--called upon owner joining and when bought if chosen in options (on by default)
onOwnerJoin = function(player)
print("Thx for buying and coming back")
end
},
{
buyAndOwnerJoin = true
})
GL Lib is integrated into the config module script, it contains four functions that will be useful when expanding the system. getGamepassById(int Id), getGamepassByName(string Name), getDevproductById(int Id), and getDevproductByName(string Name). they do exactly as they say but if needed documentation can be found in the freemodel
I can see that this works when a player buys a gamepads and I honestly think its very neat and clean interface which appears easy to use, However how does It work in relation to a player joining a game who already owns the gamepass, maybe the ability to add a bool allowing us to enable / disable if that function will be called if a player joins with the gamepass would be useful.
If you were looking for further ways to expand this system, adding dev product support would be a useful step towards making it an all in one solution to easy payment system setups. Maybe being able to do module.DevProducts = {} would be the best way to attempt this.
I’ll probably do a complete rewrite to add support for everything marketplaceservice offers. I made this as part of a commission I’m doing, it’s a simulator so alot of devproducts. I’ll probably just make a highly custom one, I wanted to share this as I love helping people and I could see this being useful.