How to make owned gamepass is passed?

It’s kind of hard to say but here is the code.

local TweenService = game:GetService("TweenService")

local ScreenUI = script.Parent.Parent.Parent.Parent
local ClassFrame = ScreenUI.ClassFrame
local FlightInfo = ScreenUI.FlightInfoFrame

local Button = script.Parent
local Information = ClassFrame.Information
local OrignialText = Information.Text
local GamePassID = 8429068643
local Player = game.Players.LocalPlayer
	
local PlayerHasTicket = false

Button.MouseButton1Click:Connect(function()
	if PlayerHasTicket == false then
		Information.Text = "Please purchase a ticket!"
		wait(1)
		game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, GamePassID)
		Information.Text = OrignialText
		
	elseif PlayerHasTicket == true then
		Information.Text = "Comfirmation Completed"
		wait(1)
		Information.Text = OrignialText
	
		TweenService:Create(ClassFrame, TweenInfo.new(0.9, Enum.EasingStyle.Back, Enum.EasingDirection.In), {Position = UDim2.new(0.125, 0, 1.131, 0)}):Play()
		task.wait(0.9)
		TweenService:Create(FlightInfo, TweenInfo.new(0.9, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Position = UDim2.new(0.125, 0, 0.131, 0)}):Play()
	end
end)




If player doesn’t have gamepass it wont go to next page and get purchase ui. But it doesnt work.

Any issues in output?

No. I can’t find any errors.

Maybe just use a UIPageLayout instead?

Also, try running the prompt from a server script instead of a local script, I believe that should work.

Okay. Let me do that.

image
Actually i am making like this.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.