I had an idea for randomizing the stats of every artifact that's spawned and adjusting their sale value accordingly. After putting math.random(1,100) after some of their stats and having the stats come up as 0 in game, I started looking at the LootMoney script as a good place to start, but I'm wondering how I would get each artifact to execute a script when it spawns, then check it's local variables to see if they're not equal to 0.
The idea is on spawn, the script goes through each stat (burn immunity, strike immunity etc) and if the stat is not 0, it rolls a random percentage and adjusts the number by that much (positive or negative). Bad traits would affect the value negatively and good traits would increase the value by percentages based on the new results.
Any way, any help would be much appreciated!