So, my Vip door is a gamepass, and I have done soooooo much but it wont work! I dont know whats going on, but im not getting any errors either. Please help me!
local Id = 5266510 script.Parent.Touched:Connect(function(hit) --hit if hit.Parent:FindFirstChild("Humanoid") then --makes sure the object touching the door is a player local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,Id) then script.Parent.CanCollide = false end end end)
So, I will presume you made a game pass after the new game pass update. You can read more about the game pass changes here
Basically this means you can no longer use MarketplaceService to check if someone owns a game pass. NOTE: This only counts for people who made game passes AFTER the new update. Old game passes must use the MarketplaceService:UserOwnsGamePassAsync(userId, gamepassId)
To check if someone owns a game pass, you have to use GamePassService:PlayerHasPass(Player, PassId)
To solve your problem:
local Players = game:GetService("Players"); local GamePassService = game:GetService("GamePassService"); local door = workspace.Door; local passId = 123 door.Touched:Connect(function(hit) if hit and hit.Parent:FindFirstChildOfClass("Humanoid") then local player = Players:GetPlayerFromCharacter(hit.Parent); if player then local ownsPass = GamePassService:PlayerHasPass(player, passId) door.CanCollide = false end end end)