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

Why Is this piece of Code not Disabling My GUI if you own a gamepass?

Asked by 4 years ago

I have been trying for a few days to make this and it has just not been working I think my code is fine but I need some help

local id = 8075708

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
    if purchased and ido == id then
        script.Parent.Parent.ScreenGui.Visible = false
    end
end)
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
            script.Parent.Parent.ScreenGui.Visible = false
    end)
end)

I don't see whats wrong can someone please help me?

Answer this question