Project Zomboid

Project Zomboid

Silencer / Suppressor Mod (Build 41)
David Hasihoff 2020 年 5 月 23 日 下午 11:40
HC issues
Hi Nolan, i added 2 Hydrocraft guns and wanted to add silencers too. So .. it would be cool if you would add the HCUzi or move the set soundvolume/radius/sound into the function to detect the silencer type because as it is now you would overwrite another type of silencer written by somebody else (Like me :-D )

if item:getCanon():getType() == "Silencer" then
soundVolume = soundVolume * (0.10)
soundRadius = soundRadius * (0.10)
swingSound = 'silenced_shot'
item:setSoundVolume(soundVolume)
item:setSoundRadius(soundRadius)
item:setSwingSound(swingSound)
elseif item:getCanon():getType() == "HMSilencer" then

soundVolume = soundVolume * (0.25)
soundRadius = soundRadius * (0.25)
swingSound = 'silenced_shot'
item:setSoundVolume(soundVolume)
item:setSoundRadius(soundRadius)
item:setSwingSound(swingSound)
end
最后由 David Hasihoff 编辑于; 2020 年 5 月 23 日 下午 11:42