Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how would i create a team where i can assign who is on what team?

i want to have like only certain people on certain teams then one team that any one can be one

1 answer

✓ Accepted answer

The team doesn't matter, the script does.

Each player has a property called 'TeamColor'

So to assign a player to a certain team, you can do

PlayerName.TeamColor = BrickColor.new("Bright red") 

Or

PlayerName.TeamColor = Game.Teams['Red team'].Color

Thumb up and accept please :)

--[[ Updated]]--

local Players = { --List of players who get the sword
['Player1'] = true,
['Player2' = true, 
['Player3'] = true
}

Game.Players.PlayerAdded:connect(function(Player)
if Players[Player.Name] then
Game.ReplicatedStorage.Sword:Clone().Parent = Player:WaitForChild('Backpack')
--Make sure the sword name is "Sword" inside of ReplicatedStorage
end
end)

6 comments

0

okay how will i put the other people in like one team so they dont just magicly apear on my team

0

Well, there a property in a 'Team' object. Inside Game.Teams, there should be for say 'Red team' and use the properties viewer and set AutoAssignable to false

0

im super confused all i really need to do is assign a sword to certain ppl

0

Well, give me a minte and I will update my answer to show you how that would be done.

0

alright

0

still doesnt work

This discussion is preserved as it was. New answers, comments, and votes are closed.