Hey, I have made a gamepass and I want to test it but when I try to buy it on test place I got this error :
How would I be able to prevent that ?
Is it in Roblox Studio or a normal game ?
1 Like
It’s in roblox studio ! This text will be blurred
1 Like
Just go to settings of your game , enable third party sales and do a local server test one player, after testing make sure to disable third party sales!
1 Like
I will test that thx you ! This text will be blurred
1 Like
Sadly I tested it and it doesn’t work …
Yeah for sure :
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local InfiniteStaminaOwned = ReplicatedStorage.InfiniteStaminaOwned
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Button = script.Parent
local ProductId = 144584907
if InfiniteStaminaOwned.Value then
Button.Text = "Owned"
end
Button.MouseButton1Down:Connect(function()
if not InfiniteStaminaOwned.Value then
MarketplaceService:PromptProductPurchase(Player, ProductId)
end
end)
InfiniteStaminaOwned:GetPropertyChangedSignal("Value"):Connect(function()
if InfiniteStaminaOwned.Value then
Button.Text = "Owned"
end
end)
You should use
MarketplaceService:PromptGamePassPurchase(Player, ProductId)
instead of
MarketplaceService:PromptProductPurchase(Player, ProductId)
for gamepass purchases
3 Likes
Thx you so much I’m so stupid … XD
So I have turn on third party sales and I have do what you have said and that does work perfectly !
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.