Jump to content

Cursor Position


Recommended Posts

Rapaziada eu to com um erro que ta atrapalhando no meu projeto, na parte do cursor, então o problema é que quando eu clico pra ir pra outra aba ele buga completamente 

function Clicando( button, state )
if Parte == "Comida" then
	if cursorPosition (x*569, y*355, x*40, y*20) then
	Parte = "Arma"
end	
	if cursorPosition (x*366, y*355, x*40, y*20) then
	Parte = "Droga"
end
end
if Parte == "Arma" then
	if cursorPosition (x*569, y*355, x*40, y*20) then
	Parte = "Droga"
end	
	if cursorPosition (x*366, y*355, x*40, y*20) then
	Parte = "Comida"
end
end
if Parte == "Droga" then
	if cursorPosition (x*569, y*355, x*40, y*20) then
	Parte = "Comida"
end	
	if cursorPosition (x*366, y*355, x*40, y*20) then
	Parte = "Arma"
end
end
end
addEventHandler("onClientClick", getRootElement(),Clicando)

 

Link to comment
  • Moderators

Faça

if condição then

elseif condição then

end

Em vez de vários blocos de if's
E também: verifique o parâmetro button para o clique com o botão esquerdo do mouse e se o state é 'down' para não chamar duas vezes a mesma ação.

  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...