Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make it so specific teams have specific gear?

Asked by
mikwbm 9
4 years ago

i need someone to help me out if u cant explain on here explain on my discord mikwbm#8463

0
it will depent. Does it starts with character or is it collectable? Necro_las 412 — 4y

1 answer

Log in to vote
0
Answered by
sngnn 274 Moderation Voter
4 years ago

First, we will need to loop through the players.

for i,v in pairs(game.Players:GetChildren() do

end

Then, we detect the team that the player is on.

for i,v in pairs(game.Players:GetChildren() do
    if v.Team == (team) then --Is the player on this team?

    end
end

Finally, insert the tool. You can have a tool in ReplicatedStorage or insert it via the script, as well.

for i,v in pairs(game.Players:GetChildren() do
    if v.Team == (team) then --Is the player on this team?
        local tool = game.ReplicatedStorage.Tool:Clone()
        tool.Parent = player.Backpack
    end
end
Ad

Answer this question