I re-worded this, how would I be able to select a random player on a team and give them a tool?
Using the method :GetPlayers() on a team will return a table of players in the team.
local Teams = game:FindService("Teams") local ServerStorage = game:FindService("ServerStorage") local team = Teams.Team local tool = ServerStorage.Tool local function GiveRandomPlayerItem() local randPlayer = team:GetPlayers()[math.random(1,#team:GetPlayers())] tool:Clone().Parent = randPlayer.Backpack end GiveRandomPlayerItem()
A variable for the Team instance and a variable for the tool instance.
A function that will select a random player in the
team and clones the
tool and will set the parent to the specific player's backpack.
You can call the function anywhere in the
Script at any time.