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 there can only be one player?

Warden = game.Teams.Warden.TeamColor
Number = game.StarterGui["Change Team GUI"]["Switch Team"].Warden.Allowed

function Click(mouse) 
if script.Parent.TeamColor ~= game.Teams.Warden.TeamColor then
script.Parent.TeamColor = game.Teams.Warden.TeamColor 
Number.Value = Number.Value + 1
if Number.Value == 1 then 
	return nil
end
end
end
script.Parent.MouseButton1Click:connect(Click) 

Hello, I was working on this script and trying to figure out a problem. I tried to assign a NumberValue, which is called "Allowed" on the number of players on a team but it doesn't seem to be working. So what do I do? I am really confused.

~Thank you for reading, Yeevivor4

2 comments

0

Well of course it's not going to work. It will probably error with the error "TeamColor is not a valid member of TextButton"

0

So.. What do I do to resolve this?

1 answer

Warden = game.Teams.Warden.TeamColor
Number = game.StarterGui["Change Team GUI"]["Switch Team"].Warden.Allowed

function Click(mouse) 
	if script.Parent.BackgroundColor3 ~= game.Teams.Warden.TeamColor.Color then
		script.Parent.BackgroundColor3 = game.Teams.Warden.TeamColor.Color
		Number.Value = Number.Value + 1
		if Number.Value == 1 then
			return nil
		end
	end
end
script.Parent.MouseButton1Click:connect(Click) 

This MIGHT work, I can't test it at all due to I'm at school, give output if not...

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