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

bad argument #2 to '?' (string expected, got BrickColor)

Asked by 6 years ago
Edited 6 years ago

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

1
haha use in game:GetService("ReplicatedStorage").Team[Player.Team.TeamColor.Name] greatneil80 2647 — 6y
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 TheeDeathCaster 2368 — 6y
1
Ye. TeamColor is a BrickColor, and you need a string. Programical 653 — 6y

Answer this question