107 posts
Posted 27 October 2012 - 08:04 AM
So I'm trying to make a program, that when you click somewhere, something happens. But I don't get how to do it. If I click at position 5,6 for example I want something to happen, can someone make a example code and explain it?
1111 posts
Location
Portland OR
Posted 27 October 2012 - 08:08 AM
Use events to caputre where the click took place and use an if statement to check if it was in a location that it needs to do something.
local event, button, mouseX, mouseY = os.pullEvent("mouse_click")
if mouseX == 5 and mouseY == 6 then
--do stuff
end
107 posts
Posted 27 October 2012 - 09:54 AM
Thank you good sir!