ERROR: Players.Player1.Backpack.StarterScript:4: bad argument #2 to '?' (string expected, got BrickColor)

I would like make a system for my game. In ReplicatedStorage I created a folder named "Team" in this folder I have create three folder "Bright red", "Really black" and "Instutitional white". In its three folders, there is a folder named "GUI" and in this folder there is a frame. I would like that frame be cloned in the PlayerGui. Am I in the right track?

-----------------------------------------------------------------------------
local Player = game:GetService("Players").LocalPlayer
-----------------------------------------------------------------------------
local Service = game:GetService("ReplicatedStorage").Team[Player.Team.TeamColor]
-----------------------------------------------------------------------------
Service.GUI:GetChildren():Clone().Parent = Player.PlayerGui.GameGui

SORRY I DO NOT SPEAK VERY GOOD ENGLISH

3 comments

1

haha use in game:GetService("ReplicatedStorage").Team[Player.Team.TeamColor.Name]

1

Well, from how your code is set up, and how you described the purpose, I recommend using the "tostring" function, where it'll convert a value into a string; at least, this is my guess. ;P http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#tostring

1

Ye. TeamColor is a BrickColor, and you need a string.