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?
Need explanation for mouseclicks
Started by Klausar, Oct 27 2012 07:04 AM
2 replies to this topic
#1
Posted 27 October 2012 - 07:04 AM
#2
Posted 27 October 2012 - 07: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
#3
Posted 27 October 2012 - 08:54 AM
Thank you good sir!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











