I don't want it to be a choose your team thing i just want it so when they walk on the button the go to a random team. I think it goes like this...
local t1 = script.Parent.Parent.Parent.Teams.TeamColor = Brick.new("Bright blue") local t2 = script.Parent.Parent.Parent.Teams.TeamColor = Brick.new("Really red") local teams = t1.. t2 function ontouch(part) local h = game.Player:GetPlayerFromCharacter(part.Parent) if h ~= nil then h.TeamColor.new = teams end end
teams = {"Bright blue", "Really red"} --Add more brick colors here for more teams. script.Parent.Touched:connect(function() local plyr = game.Players:GetPlayerFromCharacter(part.Parent) --You said game.Player if plyr then plyr.TeamColor = teams[math.random(1,#teams)] end end)
Use a table and math.random
. This is the whole script. You can add more teams.
Tables
and
math.random