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 5 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

01local id = 8075708
02 
03game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
04    if purchased and ido == id then
05        script.Parent.Parent.ScreenGui.Visible = false
06    end
07end)
08game.Players.PlayerAdded:Connect(function(plr)
09    plr.CharacterAdded:Connect(function(char)
10        if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
11            script.Parent.Parent.ScreenGui.Visible = false
12    end)
13end)

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

Answer this question