I have a gamepass door that lets players with a specific gamepass in, but it doesn’t work because of this Infinite yield thing.
This is my gamepass script
local MarketplaceService = game:GetService("MarketplaceService")
local Player = game.Players.LocalPlayer
local doorPart = game.Workspace["MBF Restaurant V3"].GroundBase.Gamepass:WaitForChild("GamepassDoor")
local doorPart2 = game.Workspace["MBF Restaurant V3"].GroundBase.Gamepass:WaitForChild("GamepassDoor"):WaitForChild("Door2")
local gamepassId = 15143732
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, gamepassId) then
print("Player owns pass.")
doorPart.CanCollide = false
doorPart2.CanCollide = false
else
print("Player does not own pass.")
doorPart.CanCollide = true
doorPart2.CanCollide = true
end
This is how the gamepass door looks like in workspace
and this is the bug in the output tab