I am wondering how I could load guns to a team? I.e, when player becomes red, he will receive guns.
✓ ANSWER ACCEPTED
How to load guns for team?
1 answer
✓ Accepted answer
You could make a few folders in a service named after whatever teams you have and insert whatever tools you wish to award to players on the corresponding team.
local armory = "path so instance/service containing team folders"
local function setTools( player, team )
local backpack = player.Backpack
local starterGear = player.StarterGear
starterGear:ClearAllChildren();
backpack:ClearAllChildren();
for _, child in next, armory:GetChildren() do
if player[property] == BrickColor.new(child.Name) then
for _, tool in next, child:GetChildren() do
tool:Clone().Parent = starterGear
tool:Clone().Parent = backpack
end
end
end
end
game.Players.PlayerAdded:connect(function( player )
player.Changed:connect(function( property )
if property == "TeamColor" then
setTools( player, player[property] )
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
What script should it be?
What is script for guns?
Make it a server script in ServerScriptService
NVM. It's working.