so i have a slap battles-like game where i have an ability that needs robux to purchase the problem is that i cant test buy the gamepass to make sure it works correctly
heres my code:
script.Parent.MouseClick:Connect(function(player)
local smacks = player.leaderstats.Smack
local equipped = player.Equipped
local mpc = game:GetService(‘MarketplaceService’)
local ds4 = game:GetService(“DataStoreService”):GetDataStore(“–GamePass”)
local key4 = “GamePass-”…player.userId
local currency4 = {}
local GamePassID = 1143117061
local GamepassPurchased = false
local pan = player.leaderstats.Cola
local panvalue = "POWER"
local sfxpart = script.Parent.Parent.Parent.SFXpart
local yes = sfxpart.Yes
local yesS = sfxpart.YesSound
local no = sfxpart.Rejected
local noS = sfxpart.NoSound
if mpc:UserOwnsGamePassAsync(player.UserId, GamePassID) or table.find(currency4, GamePassID) then-- 0 is how much you need for it
equipped.Value = 5-- your value in the glove DUH
pan.Value = panvalue
yes.Enabled = true
yesS:Play()
wait(0.5)
yes.Enabled = false
else
no.Enabled = true
noS:Play()
mpc:PromptGamePassPurchase(player, GamePassID)
wait(0.5)
no.Enabled = false
end
end)