How to go around this script / system?

Hello, I’m creating a game where it involves cooking and cleaning at the same time, to clean you are required to press the sink and it cleans the dirty plates that are provided from cooking and the NPC’s eating; Similar to sushi shop simulator, although I need a system like their’s but I am simply confused how to go around of it.


I will be taking in suggestions and learning from those suggestions and generally learning from this knowledge and provided answers that are given to me; All suggestions are appreciated.

(Original code that I already have prior to this)

local limit = game.Workspace.CHECKPLATES.SurfaceGui.PlatesDirty.Text
-- local countup = math.random()
-- local countdown = math.random()
local click = game.Workspace.Kitchenkk.MainScriptCOnfi.ClickDetector.MouseClick


game.Workspace.Kitchenkk.MainScriptCOnfi.ClickDetector.MouseClick:Connect(function()
	game.Workspace.CHECKPLATES.SurfaceGui.PlatesDirty.Text = "⚫ 499/500"
	if limit == true then
		warn("You're overflowing")
		game.Workspace.Kitchenkk.MainScriptCOnfi.ClickDetector.MouseClick:Connect(function()
			game.Workspace.CHECKPLATES.SurfaceGui.PlatesDirty.Text = countdown
			if limit == "⚫ 499/500" then
				print("Readed")
				game.Workspace.Cooker1.board.ClickDetector.MouseClick:Connect(function()
					game.Workspace.CHECKPLATES.SurfaceGui.PlatesDirty.Text = countup
					if limit ==  "⚫ 499/500" then
						warn("Overflowing")
						if limit == false then
							print("Readed")
						else
							print("Incorrect")
						end
					end
				end)
			end
		end)
	end
end)

Many thanks,
Sam

Sorry, what was your question? What is your code supposed to do, and what parts specifically are you having trouble with?

The script isn’t doing what I want, as previously provided above, the script was meant to do this when you press the click detector on the chopping board or the sink,

Chopping Board > Makes the dirty plates go up, in the textlabel via the surfacegui inside the part.

Sink > Makes the dirty plates go down, in the textlabel via the sufacegui inside of the part.

None of these methods that I provided above worked.