a = script.Parent cd = a.coredetails color = cd.partcolorval gui = cd.gui a.Equipped:Connect(function() gui.Parent = game.Players.LocalPlayer.PlayerGui end) a.Unequipped:Connect(function() gui.Parent = cd end) a.Activated:Connect(function() local m = game.Players.LocalPlayer:GetMouse() local target = m.Target if target == nil then return end gui.colorthing.Text = "Color: "..target.BrickColor end)
1) target could be something else other than a Part so maybe you should check for that.
2) The reason for the error is that you are trying to print BrickColor
which is a userdata, usually it would get turned into a string but it doesn't for some reason now that it has some other string with it.
so all you have to do is:
gui.colorthing.Text = "Color: ".. tostring(target.BrickColor)
tostring() makes sure that what you are trying to join with that string is in fact a string as well
Tip: always use tostring() when joining to objects into one string