Forum

> > CS2D > Scripts > Lua Script Keybind
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Script Keybind

5 replies
To the start Previous 1 Next To the start

old Lua Script Keybind

romulopina
User Off Offline

Quote
Is there a way to change script's keybinds? like, usually the normal keybinds are f2,f3,f4 but per example, for people that have 2 scripts with the commands table binded on f2, only one table will run so i want to know how can i change it

old Re: Lua Script Keybind

GeoB99
Moderator Off Offline

Quote
I don't know if is possible at all, two scripts that use same serveraction key F2 can lead to conflict and won't work propely.
Only if you change the serveraction key to a key that isn't used by other scripts.

old Re: Lua Script Keybind

CaneCorso
User Off Offline

Quote
Yes yes its possible . I already made a script which open menu using E
And why wont u add it at f3 or F4 .

old Re: Lua Script Keybind

The Gajos
BANNED Off Offline

Quote
Oh my friend... you can bind 2 menus in one button (eg.: F2). I don't know how you want to change the binds but it's possible to do a dobule click for eg.: F2 to get 2nd menu, anyway I know how to do that what I said.

old Re: Lua Script Keybind

DC
Admin Off Offline

Quote
Key bindings: local client setting
Lua scripts: server sided

CS2D separates these two things for security reasons. The server is not able to change settings of clients. Otherwise a troll could setup a server which fucks up the settings of everyone who joins. This could be prevented by keeping the settings for that server only but that's not what I want. It does not feel right to allow the server to force you to use certain key bindings.

tl;dr: No, you can't change the key bindings with Lua script.

"Workaround":
There are however some player actions where you can hook in with Lua (like the use action) and also the serveractions which are bound to F2, F3 and F4 by default.

You can't change that binding but you can react to many of these player actions in your Lua scripts.

old Re: Lua Script Keybind

The Gajos
BANNED Off Offline

Quote
user romulopina by PM has written
hey bro sup, can you tell me wheres the bind is located in a script? i am using a script for admin and the menu is binded on F2, and for example if i want to run it with a gun game, super hero mod or anything else, most of them the menu is on F2 too but it conflicts...:p

PMed: Man, forum is created for these problems. In scripts buttons are binded in "serveraction" hook. Just change in one of the scripts bind from F2 to F3 and all will be ok
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview