CanCollide on part won't set to false if player owns a gamepass

In StarterPlayerScripts I have a localscript and in the workspace i have a part named barrier and if you own a gamepass for it its supposed to make the door have cancollide to false but its not working

-- LocalScript inside StarterPlayerScripts
local MarketPlaceService = game:GetService("MarketplaceService")

local VipDoor = workspace:WaitForChild("Barrier")

local GamepassId = 21923570

if MarketPlaceService:UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId,GamepassId) then
	VipDoor.CanCollide = false
	VipDoor.CanCollide = true
1 Like

If you want to make a gamepass door then it wouldn’t it be easier to place a script into the part and teleport the player into a room when the player touches the door? With your current setup I’m assuming there’s a possibility for the player to glitch in through the part via shiftlock or something.

I can try that but I think I had a union that was part of a wall covering it because even without the part there somethings blocking it but ill see

I fixed everything and now it works fine