Addon Entry

Now supporting the newest garrysmods.org

New : UserScript to add a search button to any garrysmod.org download page Script Page Install It!

Mirrors

There are no mirrors, request one in the comment section below.
File: ranged taser.zip
Version: 0
Garrysmod.org URL: http://www.garrysmod.org/downloads/?a=view&id=117629
Description: All credit for this taser goes to " The U"

You can find the original file here:
http://www.garrysmod.org/downloads/?a=view&id=89690

I found myself needing a taser that only shot within a range though, so i edited it code slightly, and now the taser only works in about a 2m radius of the victim. This is useful for cops in rp servers.

If " The U" see's this and want's it taken down, I will. The only code i added was:


local distx = eyetrace.Entity:GetPos().x - self.Owner:GetPos().x
local disty = eyetrace.Entity:GetPos().y - self.Owner:GetPos().y
local distz = eyetrace.Entity:GetPos().z - self.Owner:GetPos().z
local dist = (distx*distx)+(disty*disty)+(distz*distz)
dist= math.sqrt(dist)
if dist > 200 then return end
end

To increase/decrease the range, just alter the number 200

I'm sure this could have been done a simpler way but this is my first time using LUA.

Image: ranged