Posted 15 July 2013 - 10:20 AM
local event, btn, mousex, mouseY = os.pullEvent("mouse_click")
If mouseX>=1 and mouseX=<5 and mouseY==1 then --#Detects when the x is between 1-5 and y is equal to 1
print("test")
end
local event, btn, mousex, mouseY = os.pullEvent("mouse_click")
If mouseX>=1 and mouseX=<5 and mouseY==1 then --#Detects when the x is between 1-5 and y is equal to 1
print("test")
end
local coords = {
1,2,1,3,1,4,1,5,1,6
}
local event, btn, mouseX, mouseY = os.pullEvent("mouse_click")
for index=1, #coords, 2 do --#This will increment by two
if mouseX == coords[index] and mouseY==coords[index+1] then
print("test")
end
end
local event, btn, mousex, mouseY = os.pullEvent("mouse_click")
if mouseX>=1 and mouseX=<5 and mouseY==1 then --#Detects when the x is between 1-5 and y is equal to 1
print("test")
end
local event, btn, mousex, mouseY = os.pullEvent("mouse_click") if mouseX>=1 and mouseX=<5 and mouseY==1 then --#Detects when the x is between 1-5 and y is equal to 1 print("test") end
I think your comparison signs are mixed up. Try switching them around: >= to <=
local event, btn, mousex, mouseY = os.pullEvent("mouse_click")
if mouseX<=1 and mouseX<=5 and mouseY==1 then -- [ <= ]
print("test")
end
local event, btn, mousex, mouseY = os.pullEvent("mouse_click")
if mouseX<=1 and mouseX=<5 and mouseY==1 then -- [ =< ]
print("test")
end
local event, btn, mouseX, mouseY = os.pullEvent("mouse_click") --# the first "mouseX" here wasn't capitalized.
if mouseX >= 1 and mouseX <= 5 and mouseY == 1 then --# also, the first symbol should be >=
print("test")
end
tags