enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
|
| 12 Jun 2014 07:35 PM |
I've been trying to fix this script for days with no luck, despite health, but I simply can't get one player on one team only. --There is two spawn locations local Spawn=Instance.new("Team") Team.name=""..SpawnLocation1.BrickColor wait (.025) local Spawn=Instance.new("Team") Team.name=""..SpawnLocation.BrickColor
--Assigning teams wait (.5) for i,v in pairs(game.Players:GetChildren()) do a="Bright Green" b="Bright yellow" if i==math.random(#game.Players:GetChildren())then v.TeamColor=a else v.TeamColor=b end end a="Bright Green" b="Bright yellow" if Player.Team(a) then local Player=game.Workspace.Player.Tool ToolID=game.Workspace.Lighting.Tool else Player.Team=b local Player=game.Workspace.Player.Tool ToolID=game.Workspace.Lighting.Tool end print("TeamsAssigned"..a.value "and"..b.value)
|
|
|
| Report Abuse |
|
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
| |
|
|
| 12 Jun 2014 07:41 PM |
Should be:
v.TeamColor = BrickColor.new(a) --Or b
Also, "Bright Green" should be "Bright green".
|
|
|
| Report Abuse |
|
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
| |
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
|
| 12 Jun 2014 07:49 PM |
Do I have to create the team? Because apparently doing this isn't creating the teams. local Spawn=Instance.new("Team") Team.name=""..SpawnLocation1.BrickColor Team.Parent=game.workspace.Teams wait (.025) local Spawn=Instance.new("Team") Team.Parent=game.workspace.Teams Team.name=""..SpawnLocation.BrickColor |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 07:52 PM |
It needs to be game.Teams
Also, this part isn't going to work if Player.Team(a) then
if Player.TeamColor == a then |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 07:53 PM |
Properties are case-sensitive.
local Spawn = Instance.new("Team", Game:GetService("Teams")) Spawn.Name = SpawnLocation1.BrickColor
local Spawn = Instance.new("Team", Game:GetService("Teams")) Spawn.Name = SpawnLocation.BrickColor
|
|
|
| Report Abuse |
|
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
|
| 12 Jun 2014 08:02 PM |
It's only showing one team when I test it. And the team color is grey, instead of Brightgreen or Brightblue.
local Spawn = Instance.new("Team", Game:GetService("Teams")) Spawn.Name = game.Workspace.SpawnLocation1.BrickColor Spawn.TeamColor = game.Workspace.SpawnLocation.BrickColor
local Spawn = Instance.new("Team", Game:GetService("Teams")) Spawn.Name = game.Workspace.SpawnLocation.BrickColor Spawn.TeamColor = game.Workspace.SpawnLocation.BrickColor |
|
|
| Report Abuse |
|
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
|
| 12 Jun 2014 08:05 PM |
I get an error here on line two when I run it (The break script error where it shows me where the error is and highlights it, but nothing in the output because the script breaks) Spawn.Name = game.Workspace.SpawnLocation1.BrickColor |
|
|
| Report Abuse |
|
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
|
| 12 Jun 2014 08:07 PM |
Bump.
Error on line two: Spawn.Name = game.Workspace.SpawnLocation1.BrickColor
>Yet line 6 has the same thing without an error |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2014 08:24 PM |
Spawn.Name = tostring(game.Workspace.SpawnLocation1.BrickColor)
|
|
|
| Report Abuse |
|
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
| |
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
|
| 13 Jun 2014 08:56 AM |
| It's still trying to even out the teams :l How can I prevent this so that one person goes on Bright blue team and all others on Bright green? |
|
|
| Report Abuse |
|
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
| |
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
| |
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
| |
|
enzo90
|
  |
| Joined: 25 Mar 2012 |
| Total Posts: 7104 |
|
| |
|