I am very new to the world of Gmod coding, and coding in general. Gmod lua is really the first language I am trying to understand/learn. I’ve been doing it for less than a month.
I am currently working on a few SENTS (I think that’s what they are called) for a community i’ve been apart of for several years. The code for them was very outdated, and I was able to fix it up so it worked, and added a few things.
I have am having many difficulties with many different issues, but I don’t want to write a paragraph, so I’ll stick to the most important question for now.
It has been requested of me to add several different effects for multiple sents. The sent I am currently working on requires a sort of laser to be emitted from it, in the direction aimed, to “scan” for enemies. After a bit of studying, I figured using ents.Create with the env_laser effect would be my best bet.
I’ve tried several different times to get it to show up, even copying code and trying to modify it, but it never works. I think I’m having trouble defining the setPos for it, and the “targetname” key value(?)
If someone could show me in the right direction for creating entities for this type of application, it would help. Development for my community has been very slow, since no one except me is working on it currently.
This is really all I have currently. This is called after IN_ATTACK is triggered
function ENT:FireLaser() local Laser = ents.Create("env_laser") end
Futhermore, if anyone has any guides/videos that they know of that would possibly be of help to me in other aspects, it would be immensely appreciated.
I already know of the gmod wiki’s, aswell.