Buy a gamepass if you don't have one

Why doesn’t he offer to buy a gamepass if you don’t have one?

---Player---

local Players = game:GetService("Players")
local Player = Players.LocalPlayer

------

local Teamq = game.Teams["T.F.P"]
local PlayersTeam = Teamq:GetPlayers()
local MaxPlayer = 6

------

local GamepassID = 184269264
local Market = game:GetService("MarketplaceService")

------

local Sounds = script.Parent.Parent.Parent.Sounds
local Accept = Sounds.Accept
local Denied = Sounds.Denied

--Events---

local RemoteFolder = game.ReplicatedStorage.ChangeTeam
local RemoteEvent = RemoteFolder.ChangeTeam


------

function Click(mouse)
    if Player.Team ~= Teamq then
        if #PlayersTeam <= MaxPlayer then
            if Market:UserOwnsGamePassAsync(Player.UserId, GamepassID) then
                Accept:Play()
                RemoteEvent:FireServer(Teamq)
            else
                Denied:Play()
                Market:PromptGamePassPurchase(Player.UserId, GamepassID)
            end
        end
    end
end
script.Parent.MouseButton1Down:connect(Click)

Make sure the remote event exists as well as look in the output. I don’t think there’s an error in your script but it might be related with how it handles with the teams

This may fix that …

function Click(mouse)
    if #PlayersTeam <= MaxPlayer then
        if not Market:UserOwnsGamePassAsync(Player.UserId, GamepassID) then
            Accept:Play()
            RemoteEvent:FireServer(Teamq)
        else
            Denied:Play()
            Market:PromptGamePassPurchase(Player.UserId, GamepassID)
        end
    end
end
script.Parent.MouseButton1Down:Connect(Click)

I dont encourage making async calls like that tbh

That is just a test … need pcall that all up if it works.