I want a brick that can be walked through if someone has a gamepass and it doesn't work, here's my script (it's a local script)
local PassId = 4835177
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local getPlayerFromCharacter
local player
script.Parent.Touched:Connect(function(hit)
player = getPlayerFromCharacter(hit.Parent)
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, PassId) then
script.Parent.CanCollide = false
end
end)

2 comments
Do you own the gamepass? If not then that might be the problem. If yes, then I'll look for a solution.
Okay I realized that a LocalScript only works on certain objects. Use a normal Script.