Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a team where there can only be one player?

Asked by
Yeevivor4 155
10 years ago
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

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" Tkdriverx 514 — 10y
0
So.. What do I do to resolve this? Yeevivor4 155 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
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...

Ad

Answer this question