اعتقد انك لازم تستخدم الفنكشن المفيد في اول الكود
function isMouseInPosition ( x, y, width, height )
if ( not isCursorShowing ( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
كدة يكون احسن
addEventHandler('onClientClick',root,
function ( button , state )
if ( button == 'left' and state == 'up' ) then
if ( isMouseInPosition ( 395, 168, 97, 29 ) ) then
if ( guiGetText(time1) ~= '' and guiGridListGetSelectedItem ( grid ) ~= -1 ) then
local csel = guiGridListGetItemText(grid,guiGridListGetSelectedItem ( grid ),1)
local cser = guiGetText(time1)
triggerServerEvent ( "onTake",getLocalPlayer(),csel,cser)
else
outputChatBox('خطأ !!',0,255,0,true)
end
end
end
end
)