I want the color of the PointLight the same color of the GUI TextButton. Help?
mu has the correct answer, but his code is inefficient:
1 | local light = workspace.Part.PointLight --set this to the PointLight object |
2 | local gui = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame --set this to the GUI object you want to draw from. |
3 |
4 | gui.Changed:connect( function () |
5 | light.Color = gui.BackgroundColor 3 --Or, as mu said, TextColor3 or BorderColor3 |
6 | end ) |
Assuming you have the Script in the button and a PointLight in a part in the workspace
1 | local Light = workspace.Part.PointLight |
2 | coroutine.wrap( function () |
3 | while wait() do |
4 | Light.Color = script.Parent.BackgroundColor 3 --Or TextColor3, BorderColor3, etc... |
5 | end |
6 | end )() |