Description of what I need it to do: In my game, you start off in the lobby, which has its own team that is Medium stone grey. After a while the players in the lobby change to either red or blue randomly. Then they teleport to the map with random spawns. I have them spawning on givers... to give them they necessary tools they need, but there are some occasions to where they wouldn't receive the tools. TO THE POINT: The script is being copied from server storage and pasted into workspace at the approximate time I need the players to receive their tools. The script needs to recognize players already in the game/ on the red and blue team and give them the tools. Instead of using a lousy button giver...
Here is the script:
weapons = {game.ServerStorage.Knife:Clone(), game.ServerStorage.Pistol:Clone(), game.ServerStorage.Sniper:Clone()}
for _, v in pairs(game.Players:GetChildren()) do
if v.TeamColor == BrickColor.Red then
weapons[1].Parent = v.Backpack
end
if v.TeamColor == BrickColor.Blue then
weapons[math.random(1,2)].Parent = v.Backpack
end
end
wait(3)
script:Destroy()
Notice: Before attempting to fix it read description above script (Entirely)

2 comments
what's the parent of the script?
Workspace