How can I make it so if you own a gamepass, you get two coins instead of one?

I’m trying to figure out how to make it so if you own a gamepass, you get two coins instead of one. I’m not the best coder, so my apologizes for such a weak question. I am trying to learn along the way. Help is greatly appreciated!

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
	if player.Name ~= script.Parent.Ignore.Value then
		player.leaderstats.Coins.Value += 1
		script.Parent:Destroy()
	end
end)

Well, you can do this (I didn’t test it):

local Marketplace = game:GetService("MarketplaceService")

script.Parent.ProximityPrompt.Triggered:Connect(function(player)
    local Num = Marketplace:UserOwnsGamePassAsync(player.UserId, 0) and 2 or 1 -- instead of 0 put your pass's ID
	if player.Name ~= script.Parent.Ignore.Value then
		player.leaderstats.Coins.Value += Num
		script.Parent:Destroy()
	end
end)
2 Likes

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