检查新 Roblox 顶部栏的最佳方法是什么?

What is the best way to check for the new Roblox topbar?

许多游戏都有依赖顶部栏的 GUI,其中一些游戏被这个新的顶部栏更新弄乱了。这对于许多游戏(如 Bloxburg)和其他脚本(如使用顶部栏图标的 HD Admin)可能非常有用。截至目前,这些游戏和脚本如下所示: 哇,这个看起来真的不错!但是没有图标一致性。现在,Bloxburg: 这个需要一个重大改进。看一下聊天和菜单图标,它们是偏移的。 Coeptus 绝对可以使用一个函数来解决这个问题。那么无论如何,最好的方法是什么?

这是检查新 Roblox 顶部栏的最佳方法:

local Player = game:GetService("Players").LocalPlayer
local s, f = pcall(function()
    Player.PlayerGui:SetTopbarTransparency(1)
end)
if not  f=="SetTopbarTransparency is not a valid member of PlayerGui" then
    -- old topbar is present
else
    -- new topbar is present
end

有效,因为新的顶部栏 SetTopbarTransparency 已被弃用。