I can't find whats wrong with my code! I am getting an error, but dont know what it means
local Id = 5266510 script.Parent.Touched:Connect(function(hit) game:GetService("MarketplaceService"):PlayerOwnsAsset(Id) script.Parent.CanCollide = false end)
You didnt put the player instance in the PlayerOwnsAsset method, and the method returns a bool value so you should use an if else statement
local Id = 5266510 script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then--make sure the object touching the door is a player local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr,Id) then script.Parent.CanCollide = false end end end)