Hi, I want to check if a player owns a gamepass, then make a wall phase-through. In testing the game, I don't phase-through the wall. My code is a local script, and the child of the model wall. My code is:
game.Players.PlayerAdded:Connect(function(plr)
local ownsgamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 116471196)
if ownsgamepass then
script.Parent.CanCollide = false
else
script.Parent.CanCollide = true
end
end)
What's wrong? I don't think it's an error, because there's no blue or red squiggly line.

3 comments
do you own the gamepass and are there any errors in the output box
Yes I do own the gamepass, and the only error is this:
17:37:18.481 cloud_4678489627.Script:7: Expected ')' (to close '(' at line 6), got '.'