I haven’t got time to test it out but it maybe works when you replace steam on line 3 with license.
AddEventHandler('playerConnecting',function(Name,setKickReason,deferrals)
for _, v in ipairs(GetPlayerIdentifiers(source)) do
if string.find(v,"license") then
setKickReason("Steam has to be open before joining!") -- set reason
CancelEvent() -- stop player connecting
break
end
end
end)