I am making an entity that spawns a weapon depending on the wire input. Before, I had it set so that if the input was 1, it would spawn a .357, if it was 2, a crossbow, and so on. But I want to make it be able to spawn any weapon by inputting th name of the weapon such as weapon_smg1. I know some wire entities such as the text screen have string inputs, so I looked at the code for this, and I saw
[lua]
self.Inputs = WireLib.CreateSpecialInputs(self.Entity, { "String", "FGColor", "BGColor" }, { "STRING", "VECTOR", "VECTOR" })
[/lua]
My input before was:
[lua]
self.Inputs = Wire_CreateInputs(self.Entity, {"Weapon","Cost","Power"})
[/lua]
So I changed it to
[lua]
self.Inputs = WireLib.CreateSpecialInputs(self.Entity, {"Weapon","Cost","Power"}, {"STRING","NUMBER","NUMBER"}) [/lua]
but I got the error [addons\wire\lua\wire\server\wirelib.lua:107] attempt to index field '?' (a nil value)
Can anyone figure out why this happened, or even offer a possible solution? Please?
Sorry, you need to Log In to post a reply to this thread.