IntValue Problem [CLOSED]



As seen in the images, the value of the IntValue doesn’t change.

  • The “textlabel isn’t a texlabel. [TextButton]”

PixelArtGame.Background.PixelTab.WatermelonPixel.P1

local button = script.Parent
local WatermelonPixel = script.Parent.Parent
local ColorsTab = WatermelonPixel.ColorsTab
local ColorsCompletedTab = WatermelonPixel.ColorsCompletedTab

local color1C = ColorsCompletedTab.Color1
local color2C = ColorsCompletedTab.Color2
local color3C = ColorsCompletedTab.Color3
local color4C = ColorsCompletedTab.Color4
local color5C = ColorsCompletedTab.Color5
local color6C = ColorsCompletedTab.Color6
local color7C = ColorsCompletedTab.Color7
local color8C = ColorsCompletedTab.Color8
local color9C = ColorsCompletedTab.Color9
local color10C = ColorsCompletedTab.Color10

local color1 = ColorsTab.Color1
local color2 = ColorsTab.Color2
local color3 = ColorsTab.Color3
local color4 = ColorsTab.Color4
local color5 = ColorsTab.Color5
local color6 = ColorsTab.Color6
local color7 = ColorsTab.Color7
local color8 = ColorsTab.Color8
local color9 = ColorsTab.Color9
local color10 = ColorsTab.Color10

local value1 = color1C.Value

button.MouseButton1Up:Connect(function()
	if color1.UIStroke.Enabled == true then
		button.AutoButtonColor = false
		button.Transparency = 0
		button.BackgroundColor3 = color1.BackgroundColor3
		button.Text = ""
		value1.Value = value1.Value + 1
	else
		button.AutoButtonColor = true
		button.BackgroundColor3 = color1.BackgroundColor3
		button.Transparency = 0.25
		button.Text = "1"
	end
end)

PixelArtGame.Background.PixelTab.WatermelonPixel.ColorsCompletedTab.Color1.LocalScript

local textlabel = script.Parent
local value = script.Parent.value

textlabel.Text = value.Value.."/92"

if textlabel.Text == "2/92" then
	print("HELLOOOOOOOOO")
end
1 Like

Probably it’s because color1.UIStroke.Enabled is false. Maybe this question is best asked in scripting support instead.

Also, all those references to color buttons are probably best put into a table, and filled using a loop instead of this long list of code to find them all.

2 Likes

It’s only checking if the TextLabel’s text is equal to "2/92" when the script first runs. Try this:

value.Parent:GetPropertyChangedSignal("Text"):Connect(function()
   textlabel.Text = value.Value.."/92"

   if textlabel.Text == tostring(value) .. "/92" then
	  print("HELLOOOOOOOOO")
   end
end)
2 Likes

Nothing :frowning:


Any errors? Have you tried to see what the actual TextLabel’s text is in Explorer?


But I need script or LocalScript?

I made a mistake

This should be:

textlabel.Text = tostring(value) .."/92"
1 Like

Nothing :confused:

I found another way.
Thank you for help me!

2 Likes