#Title is help

7 messages · Page 1 of 1 (latest)

silk sail
#
local click = script.Parent.ClickDetector
local value = script.Parent.Value
local MPS = game:GetService("MarketplaceService")

local function purchase()
    local ID = 240138664
    local player = game.Players.LocalPlayer
    local haspass = false
    local success, message = pcall(function ()
        haspass = MPS:UserOwnsGamePassAsync(player.UserId, ID)
    end)
    
    if success then
        print("you have gamepass bruh")
        script.Parent.Parent.Part.Decal.Texture = "rbxassetid://16156018169"
        wait(2)
        script.Parent.Parent.Part.Decal.Texture = "rbxassetid://16155999528"
    else
        MPS:PromptGamePassPurchase(player, ID)
    end
end



click.MouseClick:Connect(function()
    if value.Value == true then
        value.Value = false
        purchase()
        script.Parent.Orientation = Vector3.new(0, 0, 85)
    else
        value.Value = true
        purchase()
        script.Parent.Orientation = Vector3.new(0, 0, 95)
    end
end)

How do I make it so this gamepass is actually promting for you and not just like ignoring it
there is no error yet its not opening it up

nova pasture
#

Wait you did

#

Ah

#

So basically.... you put that line of code under if success then

#

Success is just whether the function works or not

#

Put it outside the if statement instead