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

How do i make a team where my group members automatically assign in?

Hi!

I'm currently making a game for a group I joined, I was wondering if there was a script that makes sure people in the group get teamed ''Allies'' and people who are NOT in the group ''Enemys''

How do i do this?

I'm not good at scripting btw lol

1 answer

Here is a server side script for you to use, put it in ServerScriptService.

local groupid = 0 -- replace with your group id.
local teamcolor = game.Teams.Allies.TeamColor

game.Players.PlayerAdded:Connect(function(plr)
	if plr:IsInGroup(groupid) then
		plr.TeamColor = teamcolor
	end
end)

Also, make sure the AutoAssignable on Allies is false, and AutoAssignable in Enemys is true. You may want to change Enemys to Enemies.

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