Thiago04 Posted July 10, 2021 Share Posted July 10, 2021 is giving this error, just do not know how to tidy and would like help if possible, those are the lines. function isCursorOnElement(x,y,w,h) local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end Link to comment
nikitafloy Posted July 10, 2021 Share Posted July 10, 2021 check arguments in use your function isCursorOnElement Link to comment
AndresTVz Posted July 12, 2021 Share Posted July 12, 2021 isCursorHover = function(x,y,width,height) local sx,sy = guiGetScreenSize() if isCursorShowing() then local cX,cY,_,_,_ = getCursorPosition() if cX and cY then if cX >= x/sx and cX <= (x+width)/sx and cY >= y/sy and cY <= (y+height)/sy then return true end end end return false end If the mouse is within the values that you enter the function, it will return true. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now