So I made a script that changes a value and now I want the GUI to change Colors when it goes below a certain number :D
while true do wait() script.Parent.Text = game.Lighting.Value.Value if game.Lighting.Value.Value <= 10 then script.Parent.BackgroundColor3 = UDim2.new(221, 0, 3) end end --Output --[Players.Player1.PlayerGui.ScreenGui.TextLabel.sc:5: attempt to index field 'BackgroundColor3' (a nil value)
You're using the wrong object constructor!
What you're looking for is Color3.new()
. Try that instead. :)