• Binding Keys
    6 replies, posted
Hi, im new to this so sorry if this is the wrong place or too noobie of a question. So, I have the Ehanced Models addon and I use it on my TTT server, but I wanted to make it so that when someone joins the server the command playermodel_slecetor is automatically bound to the key F3, so the people joining dont have to do it themselves. Thankyou in advance!
Run it in a GM/ShowSpare1 hook.
Can you help me a little bit on how i can do that, I have tries setting up a .lua in autorun/client with this code but i think i made mistakes. Do i setup in the same way as this? hook.Add( "InitPostEntity", "join_con_commands", function()     RunConsoleCommand( "bind f3 playermodel_selector" ) end )
You cannot bind keys from Lua like that. Just make a ShowShare1 hook and run ply:ConCommand("playermodel_selector")
I tried like this but it doesnt seem to work, im sorry im too bad at this hook.Add("ShowSpare1", function() ply:ConCommand( "playermodel_selector" ) end)
You are missing the hook identifier in the second argument (see the InitPostEntity hook you posted earlier for example), and you didn't specify "ply" as an argument to the function.
It worked! Thanks a ton! Means a lot to someone who is starting in all of this!
Sorry, you need to Log In to post a reply to this thread.