Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Game-pass, not working when i press on a button? [STILL NOT ANSWERED]

Asked by 4 years ago

I tried creating this game-pass script that would prompt me whenever i press on it.

I think the problem has something to do when i touch it

local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local PromptSpeed = game.Workspace:WaitForChild("PromptSpeed")
local PromptBox = game.Workspace:WaitForChild("PromptPart")
local PromptPower = game.Workspace:WaitForChild("PromptJump")
local PromptVip = game.Workspace:WaitForChild("PromptVIP")

local function OnPromptPurchase(player, gamepassId)

    local HasPass = false

    local Humanoid = player.Parent:FindFirstChildOfClass("Humanoid")

    if (Humanoid) then
        player = game.Players:GetPlayerFromCharacter(player.Parent)

    HasPass = MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamepassId)   
    end

    if HasPass then print("Player has the gamepass already") return end

    if not HasPass then
        PromptSpeed.Touched:Connect(function(player)
            MarketPlaceService:PromptGamePassPurchase(player, 8638546)
            end)

                if not HasPass then
                    PromptBox.Touched:Connect(function(player)
                        MarketPlaceService:PromptGamePassPurchase(player, 8582273)
                end)
                    if not HasPass then
                        PromptPower.Touched:Connect(function(player)
                            MarketPlaceService:PromptGamePassPurchase(player, 8796152)
                    end)
                        if not HasPass then
                            PromptVip.Touched:Connect(function(player)
                                MarketPlaceService:PromptGamePassPurchase(player, 8757181)
                        end)
                    end
                    end
                    end
                    end
                    end

Please help

0
My god Ziffixture 6913 — 4y
0
Nobody is going to help if you demand for your question to be answered. Fxding_cam 60 — 4y
0
I'm sorry man. I was a douche that day. It was a problem. It's something personal i don't want to talk about : -) maxpax2009 340 — 4y
0
@Feahren - I know that i suck at scripting. You don't need to bring me down and make me stop scripting. maxpax2009 340 — 4y
View all comments (4 more)
0
It should work like that, maybe it's in the PromptVIP, etc.. G0ZZEN 17 — 4y
0
Yeah, i think so. Maybe it's something to do with if not haspass. because i wrote it 4 times. maxpax2009 340 — 4y
0
Is someone still gonna help me :( ? maxpax2009 340 — 4y
0
reupload you're question but don't make the title feel so demanding. Make you're title like this: How to make a button that prompts gamepass purchase?. and then add you're script in the desc. I already did that method and somebody actually helped me DizzyGuy70 38 — 4y

Answer this question