No announcement yet.

how to use SetPlayerWeapon ?

  • Filter
  • Time
  • Show
Clear All
new posts

    how to use SetPlayerWeapon ?

    Good evening and greetings from germany.

    after 4 hours of trying and trying how to get the "SetPlayerWeapon" command to work I am just frustrated.

    This is, how it looks in my Script (defined as SERVER-Script):

    AddCommand("weapon", function(player, model, ammo, slot)
       SetPlayerWeapon(player, 10, 100, true, 2, true)
       AddPlayerChat(player, "INFO: WAFFE ERSTELLT")
    The problem is that I don't get ANY weapon(No console-errors and the Test-Message is displayed everytime). Maybe I just don't just the function correctly ? Do I have to work with "AddRemoteEvent" ?

    The example in the Wiki ( ) also don't work for me, when I just copy everything.

    If anyone here can help me please write a tutorial how to use the function in this thread. It will be a help for others with the same problem.

    I would be thankful if the Wiki could describe it with more details how to use this function exactly.

    Thanks a lot.


    Last edited by Mike_Thurian; 12-15-2021, 07:46 PM.

    Okay I found the solution FINALLY. Just put "Weapons.lua" from the "default" folder in your custom folder and call it in "package.lua" as Client-Script.

    Please Talos
    Write this down Here ( ) so nobody has to ask again.


      Hey there. You forgot to register your Lua script in the package.json? I cannot mention that on every function description unfortunately.