Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I modify the damage in the format of game:GetService?

I would like to modify the damage of M1903 Springfield in the following format of game:GetService("ReplicatedStorage")["Shared"]["ItemData"]["Firearms"]["M1903"] but I am unsure of how to do so.

return {
	DisplayName = "M1903 Springfield",
	Type = "Firearm",
	SubType = "Rifle",
	Description = "Bolt-action American rifle. Chambered in 7.62mm Springfield.",
	Icon = 781310187,
	GridSize = {9, 4},
	SpawnRarity = 0.55,
	WorldMaximum = 20,
	PoseData = require(script:WaitForChild("Pose Data")),
	RecoilData = require(script:WaitForChild("Recoil Data")),
	ReloadData = require(script:WaitForChild("Reload Data")),
	EquipSlot = "Primary",
	AimFieldOfView = 33,
	Caliber = "7.62x63mm",
	DefaultFireMode = "Semiautomatic",
	FireRate = 40,
	InternalMag = false,
	InternalMagSize = 0,
	CanOneInTheChamber = false,
	Damage = 25,
	BurstCount = 3,
	PelletCount = 1,
	EffectiveRange = 475,
	MuzzleVelocity = 2600,
	ReloadTime = 1.15,
	ReChamberTime = 1,
	FireSound = "M1903",
	SuppressedFireSound = "M1903 Suppressed",
	ReloadSound = "Rifle 4",
	FireModes = {
			"Semiautomatic"
	},
	MagazineTypes = {
			"7.62x63mm 5rd Clip M1903"
	},
	MagazineSpawnRates = {
			["7.62x63mm 5rd Clip M1903"] = 0.5
	},
	AttachmentTypes = {
			"ACOG",
			"Holographic",
			"Kobra",
			"M68 CCO",
			"Reflex",
			"SUSAT",
			"Rifle Scope",
			"AAC Suppressor",
			"Oil Filter Suppressor",
			"Osprey Suppressor",
			"Standard Suppressor"
	},
	HitModifiers = {
			Head = 2,
			UpperTorso = 1,
			LowerTorso = 1,
			RightUpperArm = 0.8,
			RightLowerArm = 0.7,
			RightHand = 0.6,
			LeftUpperArm = 0.8,
			LeftLowerArm = 0.7,
			LeftHand = 0.6,
			RightUpperLeg = 0.8,
			RightLowerLeg = 0.7,
			RightFoot = 0.6,
			LeftUpperLeg = 0.8,
			LeftLowerLeg = 0.7,
			LeftFoot = 0.6
	}
}

1 answer

✓ Accepted answer

Mistake: It is unnecessary to use brackets for one-word objects. You should do it like this:

game:GetService("ReplicatedStorage").Shared.ItemData.Firearms:FindFirstChild("M1903")

From here, you can do this:

local M1903 = game:GetService("ReplicatedStorage").Shared.ItemData.Firearms:FindFirstChild("M1903")
M1903.Damage.Value = 25 -- Damage should be an Int/NumberValue

2 comments

0

you can click on the second set of code if it seems cut off, it's cut off for me

0

Just click view source, it's easier to copy and paste that way

This discussion is preserved as it was. New answers, comments, and votes are closed.