Jump to content

Outra Ajuda com script :D


Recommended Posts

Posted (edited)

Como eu posso fazer para bloquear o F1, F2, F3, etc... do player quando ele estiver em um marker???? Alguem me ajudaaa ?

 

Obs: Seria no Client.

Edited by Baguera
  • Other Languages Moderators
Posted

Utilize onClientKey e verifique se a tecla for uma dessas que você quer bloquear. Se for, cancele o evento com cancelEvent().

  • Thanks 1
Posted
9 hours ago, Lord Henry said:

Utilize onClientKey e verifique se a tecla for uma dessas que você quer bloquear. Se for, cancele o evento com cancelEvent().

Eu posso usar o, if button == "F1" or "F2" then 

cancelEvent()

 

Desse jeito assim, vai ??

Posted
13 hours ago, Lord Henry said:

Utilize onClientKey e verifique se a tecla for uma dessas que você quer bloquear. Se for, cancele o evento com cancelEvent().

if button == "F1" and state "down" then

cancelEvent()

Ou é desse jeito ?????

Posted
On 13/03/2021 at 09:43, Baguera said:

Eu posso usar o, if button == "F1" or "F2" then 

cancelEvent()

 

Desse jeito assim, vai ??

Seria algo assim:

 

function clientKey (button, press)
    if button == 'F1' or button == 'F2'  then
		cancelEvent ()
    end
end
addEventHandler("onClientKey", root, clientKey)

Esse código faz com que cancele a ação de apertar no botão. Se você colocar o and state == "down" só vai cancelar o evento quando apertar o botão, mas quando soltar (state == "up") ainda vai ativar.

  • Thanks 1

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...