Hello, I'm building my simulator and I want to add a feature so when you buy a game pass you get a lightning effect (I already made) and I'm wondering do I make that kind of script.
you can register an event handler on the
MarketPlaceServce.PromptGamePassPurchaseFinished event. It fires whenever a gamepass is bought (inside a game BTW).
so something like this:
local gamepassId function OnGamePassPurchase(player, gamePassId, wasPurchased) if(gamePassId == gamepassId and wasPurchased) then print(player.Name," purchased the game pass!") --put the code to give player a reward end end MarketPlaceServce.PromptGamePassPurchaseFinished:Connect(OnGamePassPurchase)
learn more here