Who are these scripts for? You need to troubleshoot performance problems with SQL Server, and you need to do it now. You don't have time to track down a bunch of DMVs, figure out Extended Events, ...
On [!INCLUDE ssNoVersion_md] and SQL Managed Instance, sys.dm_tran_locks requires VIEW SERVER STATE permission. On SQL Database Basic, S0, and S1 service objectives, and for databases in elastic pools ...