Hello Developers! I have a Huge Module Script that consists of Skills data like: Name,Damage, StaminaCost etc. I’m trying to write a code that will automatically change Certain value in each Skill, for example increase each skill StaminaCost by 1.25.
This is an example of how it looks
local Skills = {
-- Explosive Flesh
{
SkillName = "Explosion Punch",
SkillIndex = 1400,
Template = "BasicTemplate",
Animation = "rbxassetid://18625809676",
Cooldown = 20,
DecreaseCE = 19,
Damage = 24,
GiveMastery = "OnMobDeath",
NPCUseState = "Attack",
NPCUseMagnitude = 5,
},
{
SkillName = "Explosion Jump",
SkillIndex = 1401,
Template = "BasicTemplate",
Animation = "rbxassetid://18604322540",
Cooldown = 28,
DecreaseCE = 22,
Damage = 32,
GiveMastery = "OnMobDeath",
NPCUseState = "Attack",
NPCUseMagnitude = 20,
},
}
What i’ve tried so far:
- I’ve tried this code
local Skills = game.ReplicatedStorage.Scripts.Skills.Skills local reqSkills = require(Skills)
for i, v in pairs(reqSkills) do
reqSkills[i].DecreaseCE = math.floor(reqSkills[i].DecreaseCE / 1.5) print(v)
end
print(Skills.Source)
Inside the for loop it prints changed value, and when i run this script again it changes the value even more, but when im trying to print the source code to console to copy, it prints the same code as before without changes for some reason.
-
string.find() function to replace it smh but couldnt do it
-
string.format() looks like it could help but i didnt really understand how i could make it work for everything
Appreciate any help!