A few questions

  1. How do I make a “beam” from the player’s muzzle to his aimpos?

  2. How do I use text files as a “databases”?

  3. How do I make a vector…relative…to an entity…such as…Z is up/down of the ent, not the world?

  4. How fast does SetVelocity reach that vector?

  1. http://wiki.garrysmod.com/?title=Render.DrawBeam

  2. Write to the text file in a certain way so that when you read it, it makes sense. For example, if you wanted to store a player’s name and steamID, you could separate put it in this format:


From there you could use string.Explode to iterate over newlines/spaces.

  1. Something like this:

local worldvec = entity:GetPos()
local localvec = Vector( 0, 0, 10 )

localvec = worldvec + localvec

Basically, you get the “local” vector of ten units above an entity by adding the local vector to the world vector.



How do I make it so something happens when a particle touches something?


So I can make a SWEP that shoots particles and when the particles hit a player it deals damage.