hello. im trying to make a script that when the player press “apply” it turns the color of mutliple ui into whatever HEX color value they entered. im doing this to help me find a color scheme and most color scheme websites use HEX.
HOWEVER: i am OK with not using HEX if its to much trouble (just mention it!)
code:
local panel = script.Parent.Parent.Parent.panel
local GameUi = panel.Parent
local background1 = GameUi:FindFirstChild("Inventory")
local background2 = GameUi:FindFirstChild("Trade")
--
local trade = background2:FindFirstChild("Trade")
local Tbutton = trade:FindFirstChild("Tbutton")
local trade2 = background1:FindFirstChild("Trade")
local Ebutton = trade2:FindFirstChild("Ebutton")
--
local coins = GameUi:FindFirstChild("Coins")
local buttons = GameUi:FindFirstChild("Buttons")
local backgroundframe1 = background1
local backgroundframe2 = background2
--
local buttonframe1 = Tbutton
local buttonframe2 = Ebutton
--
local secondaryframe1 = coins
local secondaryframe2 = buttons
--
--
--
--
--
--
--
--
local background_color = script.parent:WaitForChild("backgroundColorTextBox")
local button_color = script.parent:WaitForChild("buttonColorTextBox")
local secondary_color = script.parent:WaitForChild("secondaryColorTextBox")
script.parent.MouseButton1Click:Connect(function()
backgroundframe1.backgroundcolor = Color3.fromhex(background_color.Text)
backgroundframe2.backgroundcolor = Color3.fromhex(background_color.Text)
--
buttonframe1.backgroundcolor = Color3.fromhex(button_color.Text)
buttonframe1.backgroundcolor = Color3.fromhex(button_color.Text)
--
secondaryframe1.backgroundcolor = Color3.fromhex(secondary_color.Text)
secondaryframe2.backgroundcolor = Color3.fromhex(secondary_color.Text)
end)
It’s not supposed to be an image. Can you try to maybe get rid of some variables so its easier for me to read and understand your code? Also, the UI that you put is still glitched for me.
local panel = script.Parent.Parent.Parent.panel
local GameUi = panel.Parent
local background1 = GameUi:FindFirstChild("Inventory")
local background2 = GameUi:FindFirstChild("Trade")
--
local trade = background2:FindFirstChild("Trade")
local Tbutton = trade:FindFirstChild("Tbutton")
local trade2 = background1:FindFirstChild("Trade")
local Ebutton = trade2:FindFirstChild("Ebutton")
--
local coins = GameUi:FindFirstChild("Coins")
local buttons = GameUi:FindFirstChild("Buttons")
local backgroundframe1 = background1
local backgroundframe2 = background2
--
local buttonframe1 = Tbutton
local buttonframe2 = Ebutton
--
local secondaryframe1 = coins
local secondaryframe2 = buttons
local background_color = script.parent.parent:WaitForChild("Background")
local button_color = script.parent.parent:WaitForChild("Buttons")
local secondary_color = script.parent.parent:WaitForChild("Secondary")
script.Parent.MouseButton1Click:Connect(function()
pcall(function() -- SO if the Hex is wrong then it doesnt error
backgroundframe2.BackgroundColor3 = Color3.fromHex(background_color.Text)
--
buttonframe1.BackgroundColor3 = Color3.fromHex(button_color.Text)
buttonframe1.BackgroundColor3 = Color3.fromHex(button_color.Text)
--
secondaryframe1.BackgroundColor3 = Color3.fromHex(secondary_color.Text)
secondaryframe2.BackgroundColor3 = Color3.fromHex(secondary_color.Text)
end)
end)
Even Though The Image Might Cover It…
Here try this to see if it works MCQUEEEN @KrimsonWoIf
hey, the code isnt really working. if you want im perfectly ok giving up on HEX. you might also want to open up the model i made since we could always be calling something incorrectly and we dont know it /shrug