How would i track asoon as a gamepass is buyed!

Hello everyone!

today i wanted to make a script so when you buy the VIP gamepass it popups with a thank you message gui but i was thinking how would i do that because i cant use PromptGamePassPurchaseFinished because if they close it they will get the message so how do i track asoon as they buy it?

2 Likes

You can add another parameter, wasPurchased, which will be true if they buy the gamepass and false if they only close the message.

More Information can be found here: MarketplaceService | Documentation - Roblox Creator Hub

Thank you!

this is my code:

MS.PromptGamePassPurchaseFinished:Connect(function(plr, id, purchased)
	if plr == player and id == 901150141 and purchased == true then
		wait(0.05)
		local frame = player.PlayerGui.VIP.VIPmessage

		frame.Position = UDim2.new(-1, 0, 0.368, 0)
		frame.Visible = true
		player.PlayerGui.VIP.VIPmessage.Visible = true

		frame:TweenPosition(UDim2.new(0.358, 0, 0.368, 0), "Out", "Quad", 0.1, true)
	end
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.