dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 09:37 AM |
while true do wait(65) --time in seconds before the players are sent to location for _, player in pairs(game.Players:GetPlayers()) do if player.TeamColor == BrickColor.new("Really Red") then player.Character:MoveTo(Vector3.new(89, 7.4, -57)) --set as position for players to go end end end
so im trying to make it where members of certain teams get sent to certain areas #swagyolo |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 19 Jul 2013 09:39 AM |
Please stick to one topic per help request. I answered your other topic, by the way. |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 09:41 AM |
Can you post the version of the script that works?
#swagyolo |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 19 Jul 2013 09:42 AM |
No, because you didn't give enough information for me to do that. I don't know what teams you have. I do not know where you want the different teams' members to be moved to. |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 09:45 AM |
oh ok theres the Really blue, New yeller, Really red, and Lime green
#swagyolo |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 09:46 AM |
blue: (89, 7.4, -159)) green: (-13, 7.4, -57)) yellow: (-13, 5.4, -159)) and red's already up in the script
#swagyolo |
|
|
| Report Abuse |
|
|
iPoopie
|
  |
| Joined: 22 May 2009 |
| Total Posts: 148 |
|
|
| 19 Jul 2013 09:48 AM |
'elseif'
i have a white van full of little children, but i just sold some to absolutelol |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
| |
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 19 Jul 2013 10:39 AM |
| Because I'm lazy, I meant the names of the teams. :P |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2013 10:51 AM |
Lua is case-sencitive, so you need to lowercase the R in 'Red' on this line:
if player.TeamColor == BrickColor.new("Really Red") then |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 10:58 AM |
christbru, was that the thing the entire time?
#swagyolo |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 19 Jul 2013 11:01 AM |
If you were asking if it was always like that.. Then yes, it was. About those team names? |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 11:05 AM |
I was asking if that was the problem that whole time. Just name the teams red, blue, yellow, and green
#swagyolo |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 11:09 AM |
btw, can anyone come up with what the name of the four teams should be?
#swagyolo |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 19 Jul 2013 11:12 AM |
while wait(65) do for _, player in pairs(game.Players:GetPlayers()) do if player.Character then if player.TeamColor == game.Teams.red.TeamColor then player.Character:MoveTo(Vector3.new(89, 7.4, -57)) elseif player.TeamColor == game.Teams.green.TeamColor then player.Character:MoveTo(Vector3.new(-13, 7.4, -57)) elseif player.TeamColor == game.Teams.blue.TeamColor then player.Character:MoveTo(Vector3.new(89, 7.4, -159)) elseif player.TeamColor == game.Teams.yellow.TeamColor then player.Character:MoveTo(Vector3.new(-13, 5.4, -159)) end end end end
You can index the teams and check their TeamColor properties, rather than comparing it to a new BrickColor. |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
|
| 19 Jul 2013 12:00 PM |
thanks. I'm going to make you VIP at my game.
#swagyolo |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2013 12:04 PM |
| Just a little stickynote: Be careful when calling game.Teams directly because if there are no teams it will cause an error and break the script, the reason for this is because Teams is actually a service, and isn't added to game unless it's needed [i.e. there are teams in it?] when running the game... so it's always better to use game:GetService('Teams') or game:service('Teams')... |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 19 Jul 2013 12:30 PM |
| True, but why would he have a script like this try to access Teams if there were none? o: |
|
|
| Report Abuse |
|
|
dewd45
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 11180 |
|
| |
|