generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Why is this team script not working?

Previous Thread :: Next Thread 
enzo90 is not online. 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 is not online. enzo90
Joined: 25 Mar 2012
Total Posts: 7104
12 Jun 2014 07:40 PM
bump
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. enzo90
Joined: 25 Mar 2012
Total Posts: 7104
12 Jun 2014 07:43 PM
Thanks!
Report Abuse
enzo90 is not online. 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
batistapowerbonbtla is not online. batistapowerbonbtla
Joined: 16 Dec 2011
Total Posts: 2203
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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 is not online. 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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
12 Jun 2014 08:24 PM
Spawn.Name = tostring(game.Workspace.SpawnLocation1.BrickColor)
Report Abuse
enzo90 is not online. enzo90
Joined: 25 Mar 2012
Total Posts: 7104
13 Jun 2014 08:41 AM
Thanks!
Report Abuse
enzo90 is not online. 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 is not online. enzo90
Joined: 25 Mar 2012
Total Posts: 7104
13 Jun 2014 09:29 AM
Bump
Report Abuse
enzo90 is not online. enzo90
Joined: 25 Mar 2012
Total Posts: 7104
13 Jun 2014 09:39 AM
Bump
Report Abuse
enzo90 is not online. enzo90
Joined: 25 Mar 2012
Total Posts: 7104
13 Jun 2014 10:09 AM
bump D:
Report Abuse
enzo90 is not online. enzo90
Joined: 25 Mar 2012
Total Posts: 7104
13 Jun 2014 11:28 AM
Bump again.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image