安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题






If it does the gun won't use it of course.
I'm glad you like the gun, I'd say it's my worst work because it's my first addon, but if you (and other people) enjoy it anyway that's good.
Anyway, the name comes from one of the challenges from Borderlands. I think it was the third or fourth level in a 'sniper rifle kills' series of challenges, and it was called 'brain ventilator.'
Also, don't be afraid to post your stuff on the workshop. The zoom code isn't my code (and neither is most of my base code, TBH).
function SWEP:IronSight()
if !self.Owner:KeyDown( IN_USE ) then
if self.Owner:KeyPressed( IN_ATTACK2 ) then
self.Owner:SetFOV( 20, 0.15 )
if ( CLIENT ) then return end
end
end
if self.Owner:KeyReleased( IN_ATTACK2 ) then
self.Owner:SetFOV( 0, 0.15 )
if ( CLIENT ) then return end
end
end
For this to work, copy this into your code, and delete everything inside function SWEP:SecondaryAttack() so that it looks like this:
function SWEP:SecondaryAttack()
end
After that's done, make a new function called function SWEP:Think() and post this inside it: self:IronSight(). It should look like this:
function SWEP:Think()
self:IronSight()
end
I found another one that includes a bunch of different codes, I think this one is going to be much better http://www.garrysmod.org/downloads/?a=view&id=128417
[ERROR] lua/weapons/ff_patrol_rifle/shared.lua:89: bad argument #1 to 'SetAngles' (Angle expected, got userdata)
1. SetAngles - [C]:-1
2. unknown - lua/weapons/ff_patrol_rifle/shared.lua:89
If the lua and weapon files aren't there, just make the folders. The lua one goes into the second garrysmod directory, and the weapons one goes into the lua folder you just made (if you had to).
I hope this isn't too confusing, but feel free to ask more questions if you need to.
First, you're going to need a base code. it's not too hard to find a basic one, you can find one on garrysmod.org . Download that and you can start from there. Here's the one that looks good: http://www.garrysmod.org/downloads/?a=view&id=83426
Also, you're going to find that it's pretty difficult to code in Notepad, so Notepad++ is going to be your friend. Get that and download the plugin for Gmod Lua. You can get said plugin by opening N++ and going to the 'plugins' tab on the top (I think so, it's been a while).
To actually use your code, save it as shared.lua to your desktop, and put it in a new folder named whatever you want.