Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

This gamepass gui isnt working some reason?howww

wait(.5)
local Product = 6862697 
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, Product)
end)
game.Players.PlayerAdded:connect(function(player)
    if game:PlayerHasPass(player,6862697) then
	player.DoublePassValue = true
end
end)

1 comment

0

First, are you using a local script? Second, I don't think game has a parameter called "PlayerHasPass" that is part of the GamePassService.

1 answer

✓ Accepted answer

Create a local script in ReplicatedFirst

local Product = 6862697 
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
	game:GetService("MarketplaceService"):PromptPurchase(player, Product)
end)

Create a server script in ServerScriptService

local Product = 6862697

game.Players.PlayerAdded:Connect(function(player)
	if game:PlayerHasPass(player,Product) then
		player.DoublePassValue = true --// Not sure what this is doing, but if DoublePassValue is a BoolValue then you'll need to put "player.DoublePassValue.Value = true"
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.