Hello, fellow ScriptingHelper users. I'm currently working on a small side project just for fun. It involves a LOT of UI works, for example, the entire game is essentially in UI's. So I have a "sidebar" which consists of 3x buttons and when the user clicks on any of the colors it changed a string value in the Workspace to an initial of whatever color it is. Sidebar Img This game is basically one of those mobile "Color by Number" games.

Well, It updates the String Value in the desktop. That's all fine. The issue is with "Picture" pixels. Here's the layout of how the pixels are laid out, for future reference. Layout The Frame is the background color, "Color" value is whatever color the pixel is, the TextButton is the part that has the number on it + what the player clicks, the script below is where the main issue is.

Here's the code for the script:

local CS = workspace:WaitForChild("Color_Selected")
local Col = script.Parent:WaitForChild("Color")

script.Parent.MouseButton1Click:Connect(function()
	print("Clicked")
	if CS == Col then
		print("Color same")
		script.Parent.Parent.BackgroundColor3 = BrickColor.new("Really red").Color
		script.Parent:Destroy()
		print("Destroyed")
	end
end)

Here's the script for the String value changer (The layout for the sidebar is similar, just remove the "Color" string value. Here's what's in the script at the bottom.

local CS = workspace:WaitForChild("Color_Selected")

script.Parent.MouseButton1Click:Connect(function()
	print("ONE_CLICKED")
	CS.Value = "RR"
end)

Mind you, it does print "ONE_CLICKED" (Or whichever number it's swapped out with) and it does update the string value in the Workspace.

(Referring to the first set of code) Not only does nothing appear in the Output (Hence the Ghostbug in the title), but I'm not sure what's wrong with it. Could anyone help me figure it out? Let me know if there's anything else you'd need!

EDIT-- It's 2:55am, I am beyond tired. I was just looking at the script and somehow didn't notice that for the past 3 hours I was missing a single .Parent argument. I lowkey want to die rn. I apologize for wasting time.

1 comment

1

How are you saying if CS == Col when the objects arent the same, they have the same values but you just did Col, not Col.Value.