I want to save coordinates in a table when the player click on a monitor. When he click the pixel become red and after 2 seconds it become blue.
My code :
tactile = {}
pixel = 1
while true do
event, side, xpos, ypos = os.pullEvent("monitor_touch")
paintutils.drawPixel(xpos, ypos, colors.red)
tactile[pixel] = {}
tactile[pixel][1] = xpos
tactile[pixel][2] = ypos
pixel = pixel + 1
sleep(2)
X = tactile[pixel][1]
Y = tactile[pixel][2]
paintutils.drawPixel(X,Y, colors.blue)
end
But with this code the pixel become red but after not blue….
Thanks for your help ! :)/>