Announcement

Collapse
No announcement yet.

how to use SetPlayerWeapon ?

Collapse
X
 
  • 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):

    Code:
    AddCommand("weapon", function(player, model, ammo, slot)
       SetPlayerWeapon(player, 10, 100, true, 2, true)
       AddPlayerChat(player, "INFO: WAFFE ERSTELLT")
    end)
    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 ( https://dev.playonset.com/wiki/SetPlayerWeapon ) 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.

    Mike



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

    #2
    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 ( https://dev.playonset.com/wiki/SetPlayerWeapon ) so nobody has to ask again.

    Comment


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

      Comment

      Working...
      X