#Show frame if I have gamepass

1 messages · Page 1 of 1 (latest)

thin juniper
#

local Players = game:GetService("Players")
local CollectionService = game:GetService("CollectionService")
local MarketplaceService = game:GetService("MarketplaceService")
local player = Players.LocalPlayer

local GAMEPASS_ID = 1205819393

local frames = script.Parent:GetChildren()

local function hasGamePass()
local success, result = pcall(function()
return MarketplaceService:UserOwnsGamePassAsync(player.UserId, GAMEPASS_ID)
end)
print("Success:", success, "Result:", result)
return success and result
end

local function updateFramesVisibility()
for _, frame in ipairs(frames) do
if frame:IsA("Frame") and CollectionService:HasTag(frame, "HorrorWrapPack") then
frame.Visible = hasGamePass()
else
frame.Visible = false
end
end
end

task.wait(1)
updateFramesVisibility()

#

If the player has the gamepass, it will show all frames that have the "HorrorWrapPack" tag

charred meteorBOT
#

studio** You are now Level 1! **studio