Jump to content

need help making a firearm item


Boneblaster

Recommended Posts

i'm new to LUA coding, but i want to make a firearm in this game regardless. it's an M16 assault rifle, chambered in the .223 caliber already ingame, and uses most attachments found ingame (excluding chokes for shotguns). i'm simply calling it "Machine Gun" to fit the nondescript firearm theme of this game, alongside guns like Pistol and Shotgun.

 

the problem is that i have no idea where to start. so far, i have a 256x256 poster image for workshop, the 32x32 icon for inventory, the firing noise and a .txt file that outlines some of the stats, placed in the media/scripts folder.

	item MachineGun	{		Type				=	Weapon,		RequiresEquippedBothHands = TRUE,		SoundVolume			=	35,		SoundGain			= 	1.2,		Icon				=	MachineGun,		DisplayName			=	Machine Gun,		Weight				=	3.6,		WeaponWeight		=	3.6,		SwingSound			=	MachineGunFire,		AmmoType			=	223Bullets,		ClipSize 			= 	24,		ReloadTime 			= 	12,		AimingTime			=	35,		HitChance 			= 	60,		MinDamage			=	1.5,		MaxDamage			=	2.5,		MinimumSwingTime	=	0.3,		MaxRange			=	20,		SwingTime			=	0.3,		SoundRadius			=	100,		MaxHitCount			=	1,		CriticalChance 		= 	30,		RecoilDelay 		= 	5,		ImpactSound	=	null,		WeaponSprite	=	Shotgun,		MinAngle	=	0.95,		ToHitModifier	=	1.5,		NPCSoundBoost	=	1.2,		KnockBackOnNoDeath	=	TRUE,		Ranged	=	TRUE,		SwingAmountBeforeImpact	=	0,		ProjectileCount	=	1,		ConditionLowerChanceOneIn	=	60,		SplatNumber	=	3,		PushBackMod	=	0.3,		SubCategory	=	Firearm,		ConditionMax	=	10,		ShareDamage	=	FALSE,		IsAimedFirearm	=	TRUE,		DoorDamage	=	5,		UseEndurance	=	FALSE,		SwingAnim	=	Rifle,		MinRange	=	0.6,		MultipleHitConditionAffected	=	FALSE,		SplatSize	=	3,		KnockdownMod	=	2,		SplatBloodOnNoDeath	=	TRUE,		RunAnim	=	Run_Weapon2,		BreakSound  =   PZ_MetalSnap,}

after this, i don't know what to do. what script is used to make this gun capable of accepting all attachment but shotgun chokes? how does the item get added to the loot table? how do i assign a reload sound to the gun, or the noise when out of ammo? i want to restrict it only to police locations, and gun stores.

 

i hope this isn't too much to ask. i don't know anything about this sort of stuff, like where to put the files either. i would try to copy a format from pre-existing gun mods, like QS on the workshop, but it's not user-intuitive.

 

thank you for your help, if you choose to help me. it's greatly appreciated!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...