Add a simple part into the Workspace. Inside that part add a ClickDetector. Inside that ClickDetector add an IntValue and a Script.
Now write this in the script:
script.Parent.MouseClick:connect(function()
local X = script.Parent.Value.Value
if X == 1 then
X = X + 1
end
end)
I thought this would add 1 to the IntValue the first time you click the part, but it doesn't. Why not?

4 comments
Please Accept the script if it is the answer!
Please don't spam the answer comments with this right after you give an answer. I haven't even been online to read it until now.
I left this comment 15 minutes after I answered. I usually don't do that unless someone upvotes or the asker comments on my answer. If you take to long then I'll also do that.
Maybe in the future wait a little longer than that to give time for the asker to actually get online. For example, in my case I asked this question, went to school, and then returned home and read your answer.