MRThinker

[Help] BindKey

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

Share this post


Link to post
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

Share this post


Link to post

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.