I am trying to make it change the color of the text that's on the surfacegui, everything else is fine but the color won't change, and it sucks that there is no error code because i can't fix it without an error
Code:
local board = game.Workspace:WaitForChild("Board")
local scriptablepart = board:WaitForChild("Scriptable")
local sgui = scriptablepart:WaitForChild("SurfaceGui")
local homeworktext = sgui:WaitForChild("HomeworkTitle"):WaitForChild("Homework")
local assignmenttext = sgui:WaitForChild("AssignmentTitle"):WaitForChild("Assignment")
local notetext = sgui:WaitForChild("TeachersNoteTitle"):WaitForChild("Note")
local editedtext = script.Parent:WaitForChild("EditedText")
local writeonboard = script.Parent:WaitForChild("WriteOnBoard")
local currentcolor = script.Parent:WaitForChild("ColorsTitle"):WaitForChild("CurrentColor")
local blackcolor = script.Parent:WaitForChild("ColorsTitle"):WaitForChild("Black")
local bluecolor = script.Parent:WaitForChild("ColorsTitle"):WaitForChild("Blue")
local yellowcolor = script.Parent:WaitForChild("ColorsTitle"):WaitForChild("Yellow")
local redcolor = script.Parent:WaitForChild("ColorsTitle"):WaitForChild("Red")
local greencolor = script.Parent:WaitForChild("ColorsTitle"):WaitForChild("Green")
local color = "Black"
local colorforcoding = "0,0,0"
currentcolor.Text = "Current: "..color.." "..colorforcoding
writeonboard.MouseButton1Click:connect(function()
homeworktext.TextColor3 = Color3.fromRGB(colorforcoding)
homeworktext.Text = editedtext.Text
end)
blackcolor.MouseButton1Click:connect(function()
color = "Black"
colorforcoding = "0,0,0"
currentcolor.Text = "Current: "..color.." "..colorforcoding
end)
bluecolor.MouseButton1Click:connect(function()
color = "Blue"
colorforcoding = "0,0,255"
currentcolor.Text = "Current: "..color.." "..colorforcoding
end)
yellowcolor.MouseButton1Click:connect(function()
color = "Yellow"
colorforcoding = "255,255,0"
currentcolor.Text = "Current: "..color.." "..colorforcoding
end)
redcolor.MouseButton1Click:connect(function()
color = "Red"
colorforcoding = "255,0,0"
currentcolor.Text = "Current: "..color.." "..colorforcoding
end)
greencolor.MouseButton1Click:connect(function()
color = "Green"
colorforcoding = "0,255,0"
currentcolor.Text = "Current: "..color.." "..colorforcoding
end)

3 comments
Make sure to leave an upvote if I helped ^.^
Explain your code! What was the asker doing wrong, and how did you fix it?
For clarification, you should not use a string in Color3.fromRGB, nor any Color3 type. However, you can transfer Color3 into a string using tostring(). What I did was have the colorforcoding value be the actual Color3 value and then have the text convert that Color3 into a string for display.