#The Kings wont turn into the "In" team

1 messages · Page 1 of 1 (latest)

rocky girder
#
Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        setupTouchEvents(player, character)
    end)
end)

for _, player in ipairs(Players:GetPlayers()) do
    if player.Character then
        setupTouchEvents(player, player.Character)
    end
end

local function startRound(duration)
    if roundActive then return end
    roundActive = true

    for i = duration, 0, -1 do
        timerEvent:FireAllClients(i)
        task.wait(1)
    end

    for _, player in ipairs(Players:GetPlayers()) do
        if player.Team == peasantsTeam then
            player.Team = outTeam
            if player.Character and player.Character:FindFirstChild("Humanoid") then
                player.Character.Humanoid.Health = 0
            else
                player:LoadCharacter()
            end

        elseif player.Team == kingsTeam then
            player.Team = inTeam
        end
    end

    roundActive = false
end

return {
    StartRound = startRound
}

flint oracle
#

your js telling the player you want to see if the player is in the KingsTeam but you havent defined what kingsteam actually is.. @rocky girder

rocky girder
#

I do have it as a variable