✓ Accepted answer
Hello.
Problem
You used LocalPlayer in a ServerScript. ServerScript's run on a physical server instead of a client, so LocalPlayer will always return nil/nothing.
Solution
Remove the player variable on the main scope. There is no need for the variable as the player is automatically obtained using the PlayerAdded parameter.
Fixed Code:
local market = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
if market:UserOwnsGamePassAsync(player.UserId, 9174386) then
print("Owns the game pass")
end
end)