Easy way to change damage done by gears from the catalog?

My game uses gears that are from the roblox catalog. I found 3 swords, and finding the damage they deal was easy to find, but now every other gear I insert, with my ~1 week of scripting knowledge, I can’t for the life of me find where I can change the damage these gears deal.
Where can I usually find damage dealt in gears?

I think you’d have to manually adjust the scripts (assuming the damage is controlled by variables inside the scripts)

In which case I’d suggest you make your own versions of the gears & replace them when people join your game. The issue with it is you’d have to do it for every gear, but I don’t know a better method than that

I wouldn’t be making this post if the damage was controlled by variables :smiley:
And making my own gears sounds like a lot of work, aaand, I’m still only really learning scripting, so it’s probably not in my skill range.

1 Like

If you’re manually importing gears, you can usually find the damage the gear does by searching “TakeDamage” or “Health =” in the script and tracing back the first parameter until you get a number.

If you’re importing gears from the catalog using InsertService during runtime, it’ll be significantly harder and maybe even impossible in some scenarios.

I think you could do it fairly easily - the problem is I haven’t really looked at the code for gears in a while, so I don’t know how they’re set up. But most of the time I think it’s a constant inside the script?

If that is the case, then you’d basically just be replacing the value of that constant - maybe setting it to 10 instead of 20, for example. I know the old swords, for example, had a constant named Damage which controlled how much damage it dealt; I think gears follow the same idea.

And then the issue would be replicating that change to the players - that’s the most difficult part of it, but I think you can do a simple replace by just replacing every tool the user has with the modified tool (with that changed constant value). So the idea there would be to have your gear replacements inside a folder in ServerStorage, loop through a player’s Backpack/StarterGear, and replace them one-by-one (if the gear exists inside that folder).

It’s definitely not an ideal method, but it’s the only one I know of. Unless you’re just looking for every tool to be half damage or something (in which case you can double the Humanoid’s Health); but then you keep the same ratios of damage for all gears.

1 Like

“But most of the time I think it’s a constant inside the script?” Most of the time it’s NOT a constant inside the script :smiley: Usually it’s a constant in swords, but if I go for ranged gears, then I can’t find where I could change the damage it deals.

“And then the issue would be replicating that change to the players” I’m not sure if I understand what you mean here correctly, but, the modified gears will be bought in a shop, so then that’s not an issue?

1 Like

Are they just doing it hard-coded? That sucks. But what @realhigbead suggested should work, in that case

And oh, my bad. I thought you were talking the players coming in with them (just letting gears in). Sorry! But yeah, listen to @realhigbead

Well, it worked for the first part in one gear, it found

humanoid:TakeDamage(Damage.Value)

but I’ve got no clue what “Damage” is

Damage = script:WaitForChild(“Damage”)

Nevermind, I went in another script and there was a variable for damage, just very hidden :smiley: @realhigbead’s tip is working, thanks :smiley:

3 Likes