It's something I've been wondering, I've tested around with server sided parts, but I'm not quite sure if local parts are able to work with a gamepass. I've tried to make a script which is shown below, which doesn't work. Info: The script Is a local script in StarterGui
MarketplaceService = game:GetService("MarketplaceService")
PassId = 271665163
modelname = "Door"
modelnametwo = "Other Door"
function respawned(char)
local player = game.Players:FindFirstChild(char.Name)
if MarketplaceService:PlayerOwnsAsset(player, PassId) then
local parts = game.ServerStorage[modelname]
parts:Clone().Parent = game.Workspace.CurrentCamera
else
local block = game.ServerStorage[modelnametwo]
block:Clone().Parent = game.Workspace.CurrentCamera
end
end
I've tested this but the parts won't even clone, also the output has no errors. Please have an explanation so I'll be able to understand why this wouldn't work.

4 comments
The script must be local to use local parts.
It's a local script in startergui
You haven't called the function, and you can also get the player by going 'local p = game.Players.LocalPlayer'
Should you have an answer so it can be considered answered? Also thanks for the help.