Owned text on your gamepass

oh I put it in the gamepass script itself lol

1 Like

wait no i havn’t:
Screenshot 2023-04-10 134654

Where’s the script.Parent.OWND?

the middle local:
Screenshot 2023-04-10 144353

No, I mean in the explorer. I don’t see a TextLabel named OWND in the buttons.

oh no i don’t have one how would i add it?

oh sorry i meant to say where to add it

No, instead of setting the ownedTXT’s text, you can set the button’s text if you want:

local MS = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
local GamePassID = 38706262
script.Parent.Activated:Connect(function()
	MS:PromptGamePassPurchase(plr, GamePassID)
end)

while task.wait(1) do
	if MS:UserOwnsGamePassAsync(plr.UserId, GamePassID) then
		script.Parent.Text = "Owned"
	else
		script.Parent.Text = "Buy"
	end
end

It’s easier

Here’s how you can make it so it doesn’t trigger a buy prompt when you own it

local MS = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
local GamePassID = 38706262
script.Parent.Activated:Connect(function()
	if script.Parent.Text == "BUY" then
		MS:PromptGamePassPurchase(plr, GamePassID)
	end
end)

while task.wait(1) do
	if MS:UserOwnsGamePassAsync(plr.UserId, GamePassID) then
		script.Parent.Text = "Owned"
	else
		script.Parent.Text = "BUY"
	end
end

oh yeah thank you i actually wondered that

1 Like

ok thanks but would i make a new script for the prompt finnish?

No, the script that I showed is enough. It wouldn’t make sense to put more effort into something that has already been solved.

ok thank you so much i appreciate your help and everyonelse too

1 Like