Jump to content

[Help] BindKey


MRThinker

Recommended Posts

it's a shared function. The main difference between server and client: server contains player variable.

client-side example:

bindKey("g","down",function()
-- your function here   
end)

-- "g" - key to press
-- "down" - key pressed ("up" if key released)

server-side example:

addEventHandler("onPlayerLogin",getRootElement(),function()
   bindKey(source,"g","down",function()
   -- your function here   
   end)
end)

-- source - player variable in this event
-- "g" - key to press
-- "down" - key pressed ("up" if key released)

@MRThinker

Link to comment
1 hour ago, JeViCo said:

it's a shared function. The main difference between server and client: server contains player variable.

client-side example:


bindKey("g","down",function()
-- your function here   
end)

-- "g" - key to press
-- "down" - key pressed ("up" if key released)

server-side example:


addEventHandler("onPlayerLogin",getRootElement(),function()
   bindKey(source,"g","down",function()
   -- your function here   
   end)
end)

-- source - player variable in this event
-- "g" - key to press
-- "down" - key pressed ("up" if key released)

@MRThinker

oh thanks

now i know bindKey :D 

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