local TipGamepassId = 9010948
local player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local click = workspace.Head.ClickTip
click.MouseClick:Connect(function()
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, TipGamepassId)
end)
if hasPass == true then
print("Player has pass")
else
MarketplaceService:PromptGamePassPurchase(player, TipGamepassId)
end
end)
For some reason when I click the “head” in this case the gamepass prompt doesn’t pop up? Tried everything and idk why?
So how would I fix it in a regular script? Cause someone told me I couldnt access local players in a script, so I have no idea what to put in the Script.
local TipGamepassId = 9010948
local MarketplaceService = game:GetService("MarketplaceService")
local click = workspace.Head.ClickTip
click.MouseClick:Connect(function(player) -- look at this thing
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, TipGamepassId)
end)
if hasPass == true then
print("Player has pass")
else
MarketplaceService:PromptGamePassPurchase(player, TipGamepassId)
end
end)
I know nothing about scripting but if you want it to be re-purchasable, you will have to make a developer product, search on YouTube how to make one if you don’t know already.
And then while trying to change it to the developer product, there comes a ID and this is a simple change from the game-pass ID to the developer product’s ID, is easy.
I hope this helps.