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

How do I make this script not teleport AFK player?

Asked by 7 years ago

It basically don't teleport player that are in "New Yeller" team, and only teleport people in "Really Red" team.

local TeleportPlayers = function()
    local spawns = newmap:FindFirstChild("Spawns")
    if spawns then
        for i,v in next, game.Players:GetPlayers() do
            if v.TeamColor == BrickColor.new("Really Red") then
                v:LoadCharacter()
                v.Character:MoveTo(spawns:GetChildren()[math.random(#spawns:GetChildren())].Position)
                local ff = Instance.new("ForceField",v.Character)
                game.Debris:AddItem(ff,.01)
            elseif v.TeamColor == BrickColor.new("New Yeller") then         
            end
        end
    end
end

But somehow the script is not working? I mean like if I have 2 players in game, 1 in "Really Red" and 1 in "New Yeller", it would not work for some reason(Not teleporting the player in "Really Red")

0
You didn't put any code for team yellow.. TheeDeathCaster 2368 — 7y
0
Because the script is suppose to do nothing if the player is in team yellow. RukyrZus 5 — 7y
0
The last line elseif v.TeamColor == BrickColor.new("New Yeller") then change new yeller to Really red.. TherDanTDM 24 — 7y

Answer this question