Hide/View Player inventory By Team

Hello! So I am trying to make a script that will make your inventory hidden when your on team (White) but when you are switched to team (Really Red) Their inventory will show. I know there’s a script to do that from game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) But how do I make it by teams only?

1 Like

This may be a bit out of context but.

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

Only close backpack’s of players’s, or the Gui of it, if you want, you might be able to use a for loop and check the player teams, then clone the items into a Folder or a Model.

You’d want to do this in a local script

local plr = game.Players.LocalPlayer

if plr.Team == game:GetService("Teams").YourTeamNameHere then
     game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
end
1 Like