#Gamepass only Gui

20 messages · Page 1 of 1 (latest)

calm pine
#

Sorry if it’s working then what’s the issue

ebon warren
#

are you referring to a gui object?

#

you could parent a gui from the script’s children to the players gui

barren pewter
barren pewter
ebon warren
#

oh wait i didnt read it properly

#

this seems to be the error

#

i believe this is the updated/correct way to figure out if someone has a gamepass

barren pewter
#

ok thanks i'll try

ebon warren
# barren pewter ok thanks i'll try
local gamepassID = 12345

game.Players.PlayerAdded:Connect(function(player)
    player:WaitForDataReady()

    local success, hasPass = pcall(function()
        return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassID)
    end)

    if success and hasPass then
        local playerGui = player:WaitForChild("PlayerGui")
        local watchFrame = playerGui:WaitForChild("Watch"):WaitForChild("Frame")
        watchFrame.Visible = true
    else
        local playerGui = player:WaitForChild("PlayerGui")
        local watchFrame = playerGui:FindFirstChild("Watch")
        if watchFrame then
            watchFrame:Destroy()
        end
    end
end)```
#

this should work

errant stoneBOT
#

studio** You are now Level 8! **studio

ebon warren
#

Are you sure? it worked for me

errant stoneBOT
#

studio** You are now Level 7! **studio

barren pewter
ebon warren
#

ServerScriptService

barren pewter
#

ahh ohhh

#

ops