Info; When the player is in the lobby they are transferred to the "Lobby" Team, when they are in the map they are transferred to the "Playing" Team. I would like for my script to disable the players backpack when they are in the Lobby, otherwise they can pull out their weapons and kill other players, which could stop them from loading into the map.
My current script is a local-script that is placed into StarterGui.
script:
game.Players.PlayerAdded:Connect(function(player)
local theTeam = player.Team.Name
if theTeam == "Playing" then
game:GetService("StarterGui"):SetCoreGuiEnabled("Backpack", true)
elseif theTeam == "Lobby" then
game:GetService("StarterGui"):SetCoreGuiEnabled("Backpack", false)
end
end)
I didn't really know what I was doing lol.

3 comments
This is almost correct, but you need to disable the backpack in LocalScript
This is a
LocalScriptalready, it works properly if you put it inStarterGuiorStarterPlayerScripts.Thanks man for taking time to help some random guy on the internet.