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

How to make a person be in a team when he/she joins?

Asked by 9 years ago

So I made a script and it turns out neat then i added a few lines then the player keeps on spawning in a team already.

ct = script.Parent.ClassHolder.CounterTerrorists
t = script.Parent.ClassHolder.Terrorists
ClassHolder = script.Parent
Teamjoined = false

function WaitTime()
    Teamjoined = true
    wait(600)
    Teamjoined = false
end

ct.MouseButton1Down:connect(function()
    if Teamjoined == false then
        game.Players.LocalPlayer.TeamColor = BrickColor.new('Really blue')
        game.Players.LocalPlayer:LoadCharacter()
        ClassHolder.Visible = false
        WaitTime()
    elseif Teamjoined == true then
        print'Error Wait Time'
    end
end)

t.MouseButton1Down:connect(function()
    if Teamjoined == false then
        game.Players.LocalPlayer.TeamColor = BrickColor.new('Really red')
        game.Players.LocalPlayer:LoadCharacter()
        ClassHolder.Visible = false
        WaitTime()
    elseif Teamjoined == true then
        print'Error Wait Time'
    end
end)

Here's also my problem. I want a player to join a team THEN he will have to wait for a couple of seconds before he/she can switch teams.

0
Can you give us the output and elaborate your question? yumtaste 476 — 9y
0
You know if you set AutoAssign to true for both teams, players will automatically be evenly placed between the two teams, right? It sounds like that's what you're trying to do. EchoReaper 290 — 9y
0
Output was nothing like it didn't print the "Error Wait Time" when a player joined a team. So here's my problem, I joined a team by pressing the button called "team 1" Then the player spawns at "Team 2" Spawn hardhitsniper 30 — 9y

Answer this question