of     1   

Auddacity
#220065898Thursday, June 29, 2017 11:33 PM GMT

I'm trying to make a lobby script, and they're two teams. So if the player team = "Robbers" then it would get teleported, and if the player team = "Cops" then they get teleported, but to a different position. I tried doing this. The problem is the player doesn't teleport, and there are no errors. This is a localscript. local target = CFrame.new(22.323, 6.1, -138.402) for i, player in ipairs(game.Players:GetChildren()) do if player.Team == "Robbers" and player.Character:FindFirstChild("HumanoidRootPart") then player.Character.HumanoidRootPart.CFrame = target print "Teleported" ----------------FULL LOBBY SCRIPT------------------ local timer = script.Parent.StatusTag local player = game.Players.LocalPlayer local maps = game:GetService("ServerStorage"):GetChildren() local chosenmap = maps[math.random(1, 2)] function begin() for i = 5, 0, -1 do -- 5 seconds for intermission wait(1) timer.Text = "Intermission: "..i if i == 0 then timer.Text = "Choose your Team!" chosenmap:Clone().Parent = game.Workspace --map preload player.PlayerGui.TeamGui.Main.Visible = true wait(5)-- 5 seconds to pick a team timer.Text = "Game Started!" player.PlayerGui.TeamGui.Main.Visible = false local target = CFrame.new(22.323, 6.1, -138.402) for i, player in ipairs(game.Players:GetChildren()) do if player.Team == "Robbers" and player.Character:FindFirstChild("HumanoidRootPart") then player.Character.HumanoidRootPart.CFrame = target print "Teleported" end end end end end begin()
Niveum
#220066073Thursday, June 29, 2017 11:36 PM GMT

Isn't the team value in a player an actual team object? So instead of player.Team == "Robbers" it'd be player.Team == game.Teams.Robbers ~ S P I C Y ~
Auddacity
#220066171Thursday, June 29, 2017 11:37 PM GMT

Thanks so much! I was stuck on that since lastnight..

    of     1