安裝 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.