检查触发 RemoteEvent 的用户是否在组中,然后继续

Check if the User who fired the RemoteEvent is in Group then Continue

我想为我的 Roblox 游戏创建一个“管理面板”。

正如标题所说,如果触发 RemoteEvent 来做某件事,我想检查用户是否在提供的 GroupId 中,然后只继续。如果用户不在发出 RemoteEvent/Executed 命令的组中,则取消请求或什么也不做。

^ 我这样做是为了防止剥削者触发 RemoteEvents 并滥用命令,即使它们不是 Admin/In 组

有没有办法做到这一点?

您可以使用 Player:isInGroup(GroupID).

检查玩家是否在特定组中
local RemoteEvent = Instance.new("RemoteEvent"); -- This shall be your RemoteEvent.

RemoteEvent.OnServerEvent:Connect(function(player)
    if not player:IsInGroup(123456) then return false end; -- If the player is not in the group, the function will not continue.

    -- Your code here.
end)