+ Reply to Thread
Results 1 to 1 of 1

Thread: Entity Discovery, LUA error after a few tries.

  1. #1
    Inactive vortexnl is on a distinguished road vortexnl's Avatar
    Join Date
    Sep 2007
    Posts
    102

    Default Entity Discovery, LUA error after a few tries.

    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:
    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)
    
    After 2 barrels I get this error:
    Code:
    Expression 2: entities\gmod_wire_expression2\core\find.lua:672: Tried to use a NULL entity!
    
    Is my expression wrong? Please correct me! :O

    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?
    Last edited by vortexnl; 05-21-2009 at 06:37 AM. Reason: I think I fixed it.
    [IMG]http://img39.imageshack.us/img39/5140/imtehpro.jpg[/IMG][URL="http://img291.imageshack.us/img291/3626/p10102811fc5.gif"]
    [/URL]

+ Reply to Thread

Similar Threads

  1. Entity Discovery Searching
    By Playzr in forum Expression Help
    Replies: 9
    Last Post: 05-16-2009, 09:04 AM
  2. Learning Entity Discovery.
    By vortexnl in forum Expression Help
    Replies: 10
    Last Post: 05-03-2009, 03:16 PM
  3. Entity Discovery Bugs
    By goluch in forum Expression Help
    Replies: 9
    Last Post: 04-19-2009, 01:06 PM
  4. Expression 2 - Entity Discovery
    By chiss in forum Wiremod Tutorials
    Replies: 12
    Last Post: 03-17-2009, 12:02 PM
  5. E2 Entity Discovery, findResult , Loops?
    By Dave-X in forum Expression Help
    Replies: 4
    Last Post: 02-09-2009, 12:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts