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

Why is my team creation script not working?

Asked by 8 years ago

Hello, I have created the script below to make teams. Only the Not It team is being created, what is the reason for that? The script is in the Workspace under a normal script object.

redTeam = Instance.new("Team", game.Teams)
blueTeam = Instance.new("Team", game.Teams)
redTeam.TeamColor = BrickColor.new("Really Red")
blueTeam.TeamColor = BrickColor.new("Really Blue")
redTeam.Name = "It"
blueTeam.Name = "Not It"
redTeam.AutoAssignable = true
blueTeam.AutoAssignable = true

Thanks for reading!

0
Your script seems to work fine in my place, you should try it again Klamman 220 — 8y

1 answer

Log in to vote
2
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
8 years ago

Problem

Lua is case sensitive!


Solution

Have correct casing on the BrickColor values. If it says "Bright blue", then you use "Bright blue" not "Bright Blue". The game is automatically combining the teams together since BrickColor.new() can not find the color you're looking for, it's defaulting to grey.


Final Script

redTeam = Instance.new("Team", game.Teams)
blueTeam = Instance.new("Team", game.Teams)
redTeam.TeamColor = BrickColor.new("Really red")
blueTeam.TeamColor = BrickColor.new("Really blue")
redTeam.Name = "It"
blueTeam.Name = "Not It"
redTeam.AutoAssignable = true
blueTeam.AutoAssignable = true

Hopefully this answered your question, if so please hit the accept answer button. If you have any questions feel free to leave a comment below and I will get back to you.
Ad

Answer this question