Here's an example:
-- LUA Script - by Dvader
-- Custom Menu
function custom_menu_init(e)
menu=0
cursor_im=LoadImage ( "scriptbank\\images\\cursor\\000.png" )
end
function custom_menu_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 1000 and menu==0 then
menu=1
cursor_sp=CreateSprite ( cursor_im )
FreezePlayer()
ActivateMouse()
end
if menu==1 then
SetSpritePosition ( cursor_sp , g_MouseX , g_MouseY )
Text(50,50,6,"Exit")
end
if g_MouseX>49 and g_MouseX<51 then -- this sets the top X coordinate of the clickable box to between 49 and 51
if g_MouseY>59 and g_MouseY<61 then -- this sets the Y coordinate of the clickable box to 59 and 61
if g_MouseClick==1 and menu==1 then
DeleteSprite(cursor_sp)
UnFreezePlayer()
DeactivateMouse()
menu=2
end
end
end
Text(50,90,6,g_MouseX.." "..g_MouseY)
end
i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.