function isMouseInPosition ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return falsew
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) )
end
addEventHandler("onClientClick", root, function(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement)
if GateMenu and button == "left" and state == "down" then
if isMouseInPosition(sx * 0.42, sy * 0.6, sx * 0.15, sim * 0.08) then
GateMenu = false
moveObject(TheGate, 5000, 51.62455, -1524.62549, 0)
GateStatus = true
triggerEvent("Reset", localPlayer)
end
end
end)
addEvent("Reset", true)
addEventHandler("Reset", root, function()
if GateStatus then
moveObject(TheGate, 100000, 1468, 51.62455, -1524.62549, 5.05399)
end
end)
tenta aassim meu querido pelo que eu li no seu codigo vc nao usou essa funçao no seu codigo if GateMenu and button == "left" and state == "down" then
e nao tem a funçao userfull
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 )
return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) )
end
tenta ai se nao der certo vem pv madrugadao#7712