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

Fix?|How do I make my game randomize the teams and make it two teams?






team = game.Teams.NHL while true do~~~~~~~~~~~~~~~~~


wait(5)~~~~~~~~~~~~~~~~~

teamstochoosefrom = math.random(1,5) if teamstochoosefrom == 1 then game.teams.NHL = team.new('Carolina Hurricanes') end~~~~~~~~~~~~~~~~~


if teamstochoosefrom  == 2 then
game.teams.NHL = team.new('Columbus Blue Jackets')
end~~~~~~~~~~~~~~~~~

if teamstochoosefrom == 3 then game.teams.NHL = team.new('New York Rangers') end~~~~~~~~~~~~~~~~~


if teamstochoosefrom  == 4 then
game.teams.NHL = team.new('New Jersey Devils')
end~~~~~~~~~~~~~~~~~

if teamstochoosefrom == 5 then game.teams.NHL = team.new('New York Islanders') end~~~~~~~~~~~~~~~~~


end


1 comment

0

You can't write HTML in the text box. Just type all your code and select it then click the code block button.

1 answer

If its team randomizing you're after then you will have to make a script in your game loop that finds every player and uses a boolen to make the last player still have a team even if the numbers not even! here's the code I would use:

-- Put this in your main Game Loop / or not XD

local NewJerseyDevilsORNOT = false
for i,player in pairs(game.Players:GetPlayers()) do
	if NewJerseyDevilsORNOT == true then
		-- Replace your New Jersey Devil team here <--
		NewJerseyDevilsORNOT = false
	else
		-- Replace your Columbus Blue Jackets team here <--
		NewJerseyDevilsORNOT = true
	end	
end

I Hope this Helped!

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