I am making a game and I want it that every person that joins a certain team will receive a tool
local ItemToGive = game.ServerStorage.Tag --Tool I want to be given local Handle = script.Parent:WaitForChild("Handle") local TeamName = "Assassins" --Give the tool to everyone on this team local NewTeam = game.Teams:FindFirstChild(TeamName) Handle.Touched:Connect(function(partHit) if partHit.Parent:FindFirstChild("Humanoid") and partHit.Parent ~= script.Parent.Parent then local Tagged = partHit.Parent game.Players:GetPlayerFromCharacter(Tagged).TeamColor = NewTeam.TeamColor end end)
Make a table of tools for speficic teams. Then in your script, once someone switches a team or spawns, add the tool to their backpack.
Example:
local Tools = { ["Team Red"] = game.ServerStorage.Tool1, ["Team Blue"] = game.ServerStorage.Tool2 } plr.CharacterAdded:Connect(function() if not plr.Team then return --return if they are not in any team end local tool = Tools[plr.Team.Name] if tool then tool:Clone().Parent = plr:WaitForChild("Backpack") end end)