This is the script. I don't know why it doesn't work.
script.Parent.Touched:Connect(function(touch)
if touch.Parent:FindFirstChild("Humanoid") then
game.Players.PlayerAdded:Connect(function(player)
local MS = game:GetService("MarketplaceService")
if MS:UserOwnsGamePassAsync(player.userId, 16777517) == true then
script.Parent.CanCollide = false
script.Parent.Transparency = 0.8
else
MS:PromptGamePassPurchase(player, 16777517)
end
end)
end
end)

1 comment
I am making sure to touch the part