How to setup a command on a keybind

Hi, I´m trying right now to setup a keybind for my /radio command. This is what i have tried but its not working.
image
This is the error code: SCRIPT ERROR: @saltyradio/client/client.lua:179: attempt to index a nil value (global ‘API’)
I don´t know what to change with the ‘API’
Any Ideas ?

1 Like

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the Cfx.re community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot:

1 Like

You should just be able registerkeymapping x +radio

1 Like

so do I enter the whole command and edit it for radio or do I only need a specific part ?

I don’t remember if it needs to be threaded or not, I’m sure someone will correct me if I’m wrong but you should just be able to yoink that thread out , one line it basically as I wrote it but as a function with arguments. And it should work.

Key bit of advice I’ve learned. If you don’t know how a native works, you can normally find examples of use cases by searching the native on github and scouting code. That is if you don’t understand what the native documentation is telling you

image
I looked around and tried some things until i got no error codes left. This is what it looks like now but theres still no action in game.

Also if you register a command with no action in the command ofcourse you’re not gonna see anything.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.