Is There a way to give item/entities directly to players? (Need Help)

!!! Sorry if this post is in the wrong place, I will move it, if that is the case !!!

Okay I’m trying to give a item directly to a player, but the item just falls to the ground :frowning:

I think this is a simple fix, but i have no idea how to fix/add it :frowning:

Shop code: from NPC_shop shared.lua

Here is the item/entity code: FA:S 2 weapons




I don’t know where you got this NPC shop from, but if this is a CoderHire addon, you just leaked it’s code meaning you’re breaking their ToS.

I got it from my friend… :S He finds the code/addons and I upload them to the server…

Then find out where it comes from. Don’t blatantly upload everything you get. You don’t want to pirate plugins, so ask him where he got it from. If it was bought from CoderHire and only used on your server (so your friend didn’t give to anyone else), you’re fine. If he shares it with multiple people, you’re wrong, and so is he.

If it’s a leaked plugin, no one is going to help you. Maybe someone can confirm which addon this NPC came from?

I can’t get in contact with him, he is on veaktion right now :frowning: But do you know if it is even possible, to add a entity directly to a player?

You can’t realy give an entity to a player switch… You can just give him some weapons.


However you can make a weapon that is spawning entitys or sents.

But can’t you give a entity the ability to auto pickup? when you walk over it?

If you want to give an attachment to a player, look at player.FAS2_PickUpAttachment(attachment, silent)

How do I use that? Sorry I sux at Lua…

ply:FAS2_PickUpAttachment(“suppressor”) in your shop’s ‘BuyFunction’

Kinda works… I don’t get the attachment but now i get a Lua Error:

and here is the code from Fas2_shared.lua