The error is "MarketplaceService:PromptGamePassPurchase() player should be of type Player, but is of type nil"
Here is the code:
local id = 6399322
script.Parent.Touched:Connect(function(hit) local plr = workspace[hit.Parent.Name] local player = game.Players:GetPlayerFromCharacter(plr) game:GetService("MarketplaceService"):PromptGamePassPurchase(player, id)-this is the line that isn't working- end)
