My script only has 3 lines, and im not getting any error message(s)
1 | local Id = 5266510 |
2 | game:GetService( "MarketplaceService" ):PlayerOwnsAsset(Id) |
3 | script.Parent.CanCollide = false |
My gamepass: https://web.roblox.com/game-pass/5266510/Vip
Script in ServerScriptService
1 | game.Players.PlayerAdded:connect( function (player) |
2 | local Id = 5266510 -- gamepass ID |
3 | if game:GetService( "MarketplaceService" ):PlayerOwnsAsset(player,Id) then -- check if they own it |
4 | workspace.Part.CanCollide = false -- change part to door name |
5 | end |
6 | end ) |
It'd be much better to use collision groups but here is how to make CanCollide on an object false if they own the gamepass.