M9K Autorun Error

Making weapons on M9K Base, after made sounds in autorun, get this error several times in console.




[ERROR] addons/ndg misc. weapons/lua/autorun/ndgautorunmisc.lua:162: '}' expected (to close '{' at line 156) near 'sound'
  1. unknown - addons/ndg misc. weapons/lua/autorun/ndgautorunmisc.lua:0



So I looked in the default autorun, everything was setup exactly the way I had it. My autorun file:



/*------------------------------------------------------

If you're reading this, then that mean's you've extracted this addon, probably with intentions 
of editing it for your own needs, or that you're using a legacy addon.

I have no problem with that, but you must understand that I cannot offer support for legacy addons.
If you've extracted this addon, I cannot offer any help fixing problems that come up. It's impossible
to know what you've changed, and thus impossible to know what to fix.

"But Bob!" you might say. "I only changed one thing!" 

Well, that's a shame. Everybody is going to say this, and I know that some of those people will be
lying to me. The only thing I can do is to refuse support to everyone using legacy addons.

So, by using a legacy addon, you accept the fact that I cannot help fix anything that might be broken.

I know it's tough love, but that's the way it's got to be.

------------------------------------------------------*/
local icol = Color( 255, 255, 255, 255 ) 
if CLIENT then
	killicon.Add( "m9k_bizonp19", "vgui/hud/m9k_bizonp19", icol  )
	killicon.Add( "m9k_colt1911", "vgui/hud/m9k_colt1911", icol  )
	killicon.Add( "m9k_coltpython", "vgui/hud/m9k_coltpython", icol  )
	killicon.Add( "m9k_deagle", "vgui/hud/m9k_deagle", icol  )
	killicon.Add( "m9k_glock", "vgui/hud/m9k_glock", icol  )
	killicon.Add( "m9k_hk45", "vgui/hud/m9k_hk45", icol  )
	killicon.Add( "m9k_luger", "vgui/hud/m9k_luger", icol  )
	killicon.Add( "m9k_m29satan", "vgui/hud/m9k_m29satan", icol  )
	killicon.Add( "m9k_m92beretta", "vgui/hud/m9k_m92beretta", icol  )
	killicon.Add( "m9k_model3russian", "vgui/hud/m9k_model3russian", icol  )
	killicon.Add( "m9k_mp7", "vgui/hud/m9k_mp7", icol  )
	killicon.Add( "m9k_ragingbull", "vgui/hud/m9k_ragingbull", icol  )
	killicon.Add( "m9k_remington1858", "vgui/hud/m9k_remington1858", icol  )
	killicon.Add( "m9k_sig_p229r", "vgui/hud/m9k_sig_p229r", icol  )
	killicon.Add( "m9k_smgp90", "vgui/hud/m9k_smgp90", icol  )
	killicon.Add( "m9k_sten", "vgui/hud/m9k_sten", icol  )
	killicon.Add( "m9k_thompson", "vgui/hud/m9k_thompson", icol  )
	killicon.Add( "m9k_usp", "vgui/hud/m9k_usp", icol  )
	killicon.Add( "m9k_uzi", "vgui/hud/m9k_uzi", icol  )
	killicon.Add( "m9k_model500", "vgui/hud/m9k_model500", icol  )
	killicon.Add( "m9k_model627", "vgui/hud/m9k_model627", icol  )
	killicon.Add( "m9k_ump45", "vgui/hud/m9k_ump45", icol  )
	killicon.Add( "m9k_mp9", "vgui/hud/m9k_mp9", icol  )
	killicon.Add( "m9k_vector", "vgui/hud/m9k_vector", icol  )
	killicon.Add( "m9k_tec9", "vgui/hud/m9k_tec9", icol  )
	killicon.Add( "m9k_mp5", "vgui/hud/m9k_mp5", icol  )
	killicon.Add( "m9k_kac_pdw", "vgui/hud/m9k_kac_pdw", icol  )
	killicon.Add( "m9k_honeybadger", "vgui/hud/m9k_honeybadger", icol  )
	killicon.Add( "m9k_mp5sd", "vgui/hud/m9k_mp5sd", icol  )
	killicon.Add( "m9k_magpulpdr", "vgui/hud/m9k_magpulpdr", icol  )
	killicon.Add( "m9k_scoped_taurus", "vgui/hud/m9k_scoped_taurus", icol  )
	killicon.Add( "m9k_mp40", "vgui/hud/m9k_mp40", icol  )
	

end

--I'm pretty sure we don't need these anymore...
--Almost 99 percent sure that's I'm 100 percent sure...
	
-- if GetConVar("M9KDisableHolster") == nil then
	-- CreateConVar("M9KDisableHolster", "0", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Disable my totally worthless and broken holster system? Won't hurt my feelings any. 1 for true, 2 for false. A map change may be required.")
	-- print("Holster Disable con var created")
-- end

if GetConVar("DebugM9K") == nil then
	CreateConVar("DebugM9K", "0", { FCVAR_REPLICATED, FCVAR_ARCHIVE }, "Debugging for some m9k stuff, turning it on won't change much.")
end

if GetConVar("M9KWeaponStrip") == nil then
	CreateConVar("M9KWeaponStrip", "0", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Allow empty weapon stripping? 1 for true, 0 for false")
	print("Weapon Strip con var created")
end
	
if GetConVar("M9KDisablePenetration") == nil then
	CreateConVar("M9KDisablePenetration", "0", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Disable Penetration and Ricochets? 1 for true, 0 for false")
	print("Penetration/ricochet con var created")
end
	
if GetConVar("M9KDynamicRecoil") == nil then
	CreateConVar("M9KDynamicRecoil", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Use Aim-modifying recoil? 1 for true, 0 for false")
	print("Recoil con var created")
end
	
if GetConVar("M9KAmmoDetonation") == nil then
	CreateConVar("M9KAmmoDetonation", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Enable detonatable M9K Ammo crates? 1 for true, 0 for false.")
	print("Ammo crate detonation con var created")
end

if GetConVar("M9KDamageMultiplier") == nil then
	CreateConVar("M9KDamageMultiplier", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Multiplier for M9K bullet damage.")
	print("Damage Multiplier con var created")
end

if GetConVar("M9KDefaultClip") == nil then
	CreateConVar("M9KDefaultClip", "-1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "How many clips will a weapon spawn with? Negative reverts to default values.")
	print("Default Clip con var created")
end
	
if GetConVar("M9KUniqueSlots") == nil then
	CreateConVar("M9KUniqueSlots", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Give M9K Weapons unique slots? 1 for true, 2 for false. A map change may be required.")
	print("Unique Slots con var created")
end
	
if !game.SinglePlayer() then

	if CLIENT then
		if GetConVar("M9KGasEffect") == nil then
			CreateClientConVar("M9KGasEffect", "1", true, true)
			print("Client-side Gas Effect Con Var created")
		end
	end

else
	if GetConVar("M9KGasEffect") == nil then
		CreateConVar("M9KGasEffect", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Use gas effect when shooting? 1 for true, 0 for false")
		print("Gas effect con var created")
	end
end

sound.Add({
	name = 			"BaseShot",
	channel = 		CHAN_USER_BASE+10,
	volume = 		1.0,
	sound = 			"weapons/"
})

sound.Add({
	name = 			"scarl.Fire1",
	channel = 		CHAN_USER_BASE+10,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_Fire"
})

sound.Add({
	name = 			"BaseNoise",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/"
})

sound.Add({
	name = 			"Weapon_SCARL.ClothMovement",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClothMovement.wav"
})

sound.Add({
	name = 			"Weapon_SCARL.ClothMovement2",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClothMovement2.wav"
})

sound.Add({
	name = 			"Weapon_SCARL.ClipOut",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClipOut.wav"
})

sound.Add({
	name = 			"Weapon_SCARL.ClipInsert",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClipInsert.wav"
	
	sound.Add({
	name = 			"Weapon_SCARL.ClipIn",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClipIn.wav"
})

sound.Add({
	name = 			"Weapon_SCARL.BoltRelease",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_BoltRelease.wav"
})

sound.Add({
	name = 			"Weapon_SCARL.ClothMovement4",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClothMovement4.wav"
})



})



m9knpw = {}
table.insert(m9knpw, "m9k_davy_crockett_explo")
table.insert(m9knpw, "m9k_gdcwa_matador_90mm")
table.insert(m9knpw, "m9k_gdcwa_rpg_heat")
table.insert(m9knpw, "m9k_improvised_explosive")
table.insert(m9knpw, "m9k_launched_davycrockett")
table.insert(m9knpw, "m9k_launched_ex41")
table.insert(m9knpw, "m9k_launched_m79")
table.insert(m9knpw, "m9k_m202_rocket")
table.insert(m9knpw, "m9k_mad_c4")
table.insert(m9knpw, "m9k_milkor_nade")
table.insert(m9knpw, "m9k_nervegasnade")
table.insert(m9knpw, "m9k_nitro_vapor")
table.insert(m9knpw, "m9k_oribital_cannon")
table.insert(m9knpw, "m9k_poison_parent")
table.insert(m9knpw, "m9k_proxy")
table.insert(m9knpw, "m9k_released_poison")
table.insert(m9knpw, "m9k_sent_nuke_radiation")
table.insert(m9knpw, "m9k_thrown_harpoon")
table.insert(m9knpw, "m9k_thrown_knife")
table.insert(m9knpw, "m9k_thrown_m61")
table.insert(m9knpw, "m9k_thrown_nitrox")
table.insert(m9knpw, "m9k_thrown_spec_knife")
table.insert(m9knpw, "m9k_thrown_sticky_grenade")
table.insert(m9knpw, "bb_dod_bazooka_rocket")
table.insert(m9knpw, "bb_dod_panzershreck_rocket")
table.insert(m9knpw, "bb_garand_riflenade")
table.insert(m9knpw, "bb_k98_riflenade")
table.insert(m9knpw, "bb_planted_dod_tnt")
table.insert(m9knpw, "bb_thrownalliedfrag")
table.insert(m9knpw, "bb_thrownaxisfrag")
table.insert(m9knpw, "bb_thrownsmoke_axis")
table.insert(m9knpw, "bb_thrownaxisfrag")
table.insert(m9knpw, "bb_planted_alt_c4")
table.insert(m9knpw, "bb_planted_css_c4")
table.insert(m9knpw, "bb_throwncssfrag")
table.insert(m9knpw, "bb_throwncsssmoke")
table.insert(m9knpw, "m9k_ammo_40mm")
table.insert(m9knpw, "m9k_ammo_40mm_single")
table.insert(m9knpw, "m9k_ammo_357")
table.insert(m9knpw, "m9k_ammo_ar2")
table.insert(m9knpw, "m9k_ammo_buckshot")
table.insert(m9knpw, "m9k_ammo_c4")
table.insert(m9knpw, "m9k_ammo_frags")
table.insert(m9knpw, "m9k_ammo_ieds")
table.insert(m9knpw, "m9k_ammo_nervegas")
table.insert(m9knpw, "m9k_ammo_nuke")
table.insert(m9knpw, "m9k_ammo_pistol")
table.insert(m9knpw, "m9k_ammo_proxmines")
table.insert(m9knpw, "m9k_ammo_rockets")
table.insert(m9knpw, "m9k_ammo_smg")
table.insert(m9knpw, "m9k_ammo_sniper_rounds")
table.insert(m9knpw, "m9k_ammo_stickynades")
table.insert(m9knpw, "m9k_ammo_winchester")

function PocketM9KWeapons(ply, wep)

	if not IsValid(wep) then return end
	class = wep:GetClass()
	m9knopocket = false
	
	for k, v in pairs(m9knpw) do
		if v == class then
			m9knopocket = true
			break
		end
	end
	
	if m9knopocket then
		return false
	end
	
	--goddammit i hate darkrp
	
end
hook.Add("canPocket", "PocketM9KWeapons", PocketM9KWeapons )

small_autorun_mounted = true


What the hell are you doing



sound.Add({
	name = 			"Weapon_SCARL.ClipInsert",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClipInsert.wav"
	
	sound.Add({
	name = 			"Weapon_SCARL.ClipIn",
	channel = 		CHAN_ITEM,
	volume = 		1.0,
	sound = 			"weapons/scar/SCARL_ClipIn.wav"
})


[editline]20th October 2014[/editline]

This is the reported error at line 156, modified to account for /* */ it is approximately line 175 (somewhere before that)

Alright fixed that error, thanks, I’m stupid, but my sounds won’t play. I’ve checked to see if they are the right names and they are, and there is no error in the console.

I know you said you got it fixed but what I recommend is that you use


resouce.AddFile ( "dir" )

or


resouce.Workshop ( "workshop ID" )

It’s hard for things to go wrong when using that unless it’s the actual lua code problem of what you are trying to get the client to download.