i give full credit to mystic :)/>/> thx dude

local sInputSide = "left" – change to the side of the redstone input (where the wire is)

local count = 0
local lastInput = false

while true do
os.pullEvent("redstone")
local input = rs.getInput(sInputSide)
if input ~= lastInput then
if input then
count = count + 1
print(count, " Units you wanna count in or count:")
end
lastInput = input
end
end