fgfbfrj
(HowBizzare)
#1
I want to change gui object background color ,but it gives me an error in return and I don’t understand why.
Here’s an example how it looks like.
local black = Color3.new(0,0,0)
local GUIobject = script.Parent
GUIobject.BackgroundColor3 = black
--output BackgroundColor3 cannot be assigned to
Could you take a screenshot of the entire error? I think that’ll make it easier to figure out what the problem is.
Can’t you just use Color3.fromRGB
?
M7mdm3rq
(M7mdm3rq)
#4
What is the GUI object you trying to set the color of?
Operatik
(Operatik)
#5
I wonder why’d you do it in the deferred way. You should instead use:
local GUIobject = script.Parent
GUIobject.BackgroundColor3 = Color3.new(0,0,0)
fgfbfrj
(HowBizzare)
#6
No beacuse i made palette of colors and they must fit into if statements and make mess on the way
D0RYU
(nici)
#7
if new didn’t work then RGB won’t work either
EDIT: rgb looked weird because of autocorrect
What did it print? Click on the drop down menu.
D0RYU
(nici)
#10
maybe this is nil???
but it would say it can’t assign to nil not “”
never got that error where it says nothing at all
fgfbfrj
(HowBizzare)
#11
how black variable could be nil?
Ok then the problem is probably that the object you are trying to set the BackgroundColor3 to is not a frame.
So before you set the background color you should check if it is a frame like so:
if v:IsA("Frame") then ...
Try printing all of the table’s value’s children’s BackgroundColor3
’s to see which one is causing the problem.
D0RYU
(nici)
#14
like I said I never got it to say nothing at the end so I’m guessing
fgfbfrj
(HowBizzare)
#15
it is beacuse i cloned this object form replicated storage and it’s class name is a frame
1 Like
D0RYU
(nici)
#17
when I say nothing I’m not talking about nil
idc if they mean the same thing
do you want me to continue saying “”
that’s kinda annoying
fgfbfrj
(HowBizzare)
#18
I’m trying to solve the problem and that’s why I am here.
Operatik
(Operatik)
#19
Why are you using GetGuiObjectsAtPosition
anyways? That could be the problem.
fgfbfrj
(HowBizzare)
#20
How this could be a problem?
It just gets instances and returns a table.