GetDescendants not working

Hey! I’m trying to make a local script that’ll change the color of something depending on what team you’re on, but I can’t seem to get it to work.
when I test it I get this error:
Players.LuigiLament.PlayerGui.Scripts.Color:8: attempt to call a table value

local Tool = game.Workspace.Tools
local Team = game:GetService("Teams")["Green"]
local plr = game.Players.LocalPlayer

plr:GetPropertyChangedSignal("Team")
print(plr.Team)
	if plr.Team == Team then
	for _, thing in ipairs(Tool:GetDescendants()()) do
		if thing:IsA("SelectionBox") then 
			thing.Color3 = Color3.new(0,1,0)
			thing.Color3 = Color3.new(0,1,0)
			end
end
end

also a bit of a side thing, but does anyone know how to set a color3 value to one of another object? like a part’s or a team color?

You put 2 () there. Remove one of the sets.

1 Like

for _, thing in ipairs(Tool:GetDescendants()) do

1 Like

yeah that fixed it! thanks, can’t believe I missed that.

Part = Part.BrickColor
Team = Team.TeamColor (use BrickColor value to change color)

well I couldn’t use brickcolor, the object im using ONLY takes color3s
is there a way to convert brickcolors to color3?

BrickColor.new("Really red").Color will get the Color3 of Really red, basically just put a .Color infront of a BrickColor value and it’ll get the color3 of it.

1 Like