Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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
0
you can click on the second set of code if it seems cut off, it's cut off for me DeceptiveCaster 3761 — 5y
0
Just click view source, it's easier to copy and paste that way seith14 206 — 5y
Ad

Answer this question