wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
549 stars 333 forks source link

Getting armor() from an npc entity returns a nil value, causes script error #3093

Closed dragitz closed 2 months ago

dragitz commented 2 months ago

Wiremod version: Current steam workshop

Console output sv: Expression 2 (Armor bug): Internal error 'entities/gmod_wire_expression2/core/player.lua:128: attempt to call method 'Armor' (a nil value)' at line 4, char 5

Minimal code:

@name Armor bug
event tick()
{
    Armor = owner():aimEntity():armor()
}

Look at the spawned npc to trigger the error