My goal was to make an expression that if you spawn an explosive barrel, it flies towards the owner, and probaly kills him.
This is my script:
After 2 barrels I get this error:Code:@name Explosive Barrel Killer @inputs Button @outputs @persist Barrel:entity Owner:entity Pos:vector Vector:vector runOnTick(1) if(Button){ findByModel("models/props_c17/oildrum001_explosive.mdl") } Barrel=findClosest(entity():pos()) Owner=Barrel:owner() Pos=Owner:pos() Vector=Pos-Barrel:massCenter() Barrel:applyForce(Vector*100)
Is my expression wrong? Please correct me! :OCode:Expression 2: entities\gmod_wire_expression2\core\find.lua:672: Tried to use a NULL entity!
EDIT: I kinda fixed it, I got rid of the runOnTick(1) and changed it with interval(100).
Is there an other way to fix this? Maybe by letting it search based on a timer?


LinkBack URL
About LinkBacks




Reply With Quote
Bookmarks