• Troubles with npcs
    3 replies, posted
I'm trying to get this to work so that when you talk to an NPC you can give them guns and such, however when I do I get this error; Attempted to create unknown entity type Weapon [103]! [code] function armFriend(ply) toGive=ply:GetActiveWeapon() Talk=ply:GetNWEntity("TalkingTo") toTake=tostring(toGive) ply:StripWeapon(toTake) Talk:Give(toTake) ply:ChatPrint("Thank you so much!") end [/code]
Rather than using tostring on the weapon object, you want to use weapon:GetClass().
Will that fix it? I'll try that though, thanks.
[code] function armFriend(ply) MyWeapon=ply:GetActiveWeapon() Talk=ply:GetNWEntity("TalkingTo") ply:StripWeapon(MyWeapon) Talk:Give(MyWeapon) ply:ChatPrint("Thank you so much!") end [/code] There you go. Also you had 3 variables that all held the same information >.<
Sorry, you need to Log In to post a reply to this thread.