LUA Discussion

I recently started getting into LUA for console commands. I wish to add the cig_smoke.pcf to the Spy from Team Fortress 2 into my picture but I have a few issues.

First off, I spawn the effect just fine. Thanks to a previous forum user I was able to use the code

lua_run ParticleEffect ( “critgun_weaponmodel_red”, Entity(1):GetEyeTrace().HitPos + Vector(0,0,100), Angle(0,0,0), nil )

to successfully upload the effect. When I did though I noticed the LUA cannot be moved via the Physgun at least as of right now.

1. Is it possible to move LUA with the physgun?

2. If not what is the command to deleting the LUA you just spawned so you can try again and again till you position it right.

3. Is there any possible way to pose the LUA Particle Effect without having to do it manually in the console.

4. If so is there a way to look at you (x,y,z) coordinates to make the placing much easier.

Thanks to anyone that can help me out of this little pickle. I would prefer if I can just do this in the console but if it requires me to do a little notepad work I’m fine with that too.

Wrong forum. http://facepunch.com/forums/65

  1. Lua is a scripting language, you can’t “move” it. You can’t move particle effects with physgun either, unless you parent the effect to a prop or any other entity.

  2. You can only remove attached to entity particles.

  3. No, unless you code functionality.

  4. You can use traces to do that.

Answer to 4: How do you enable traces and this thread is solved

You don’t “activate” it, but http://wiki.garrysmod.com/page/util/TraceLine

So do I just attach that tracer code to the lua_run one I have? Sorry but I’m still fairly new.

I have no idea what you are trying to do, the code you have will already create the effect at the position you look at.

What I’m trying to do is put an particle effect. But everytime I get it incorrectly I don’t know how to get rid of it and try again and again till I get it right. Is there anyway to undo your particle effect insertion so I dont have millions of smoke effects just cause I didn’t get the right coordinates.

EDIT: Basically all I’m trying to do is find a code that will delete the LUA I created so I can keep adjusting the Vector X , Y , Z till I get the right position. If I don’t I’m going to have a bunch of particle effects all over my screen and I cant just simply CTRL - Z undo to get rid of them since it’s a LUA. If someone could show me a code or some way to make it that I can get the particle effect LUA in the right position.

Sorry for double posting but still having this little problem.