picking up a item that has weight, the weight can be of any number really, i just want to count up by 10’s to see how much walkspeed i have to subtract
@12345koip No im saying like, The player picks up a tool that has a defined weight value in it,
The weight value goes to this script, This script counts up by 10 FROM the weight, 10, 20, 30 (etc) until theres no more 10’s to count. After this it gives me a variable of how many times it counted up from 10.
Have an IntValue inside the weight object holding how many it has.
Then:
local weight = -- path to your weight
local weightIntValue = weight:WaitForChild("IntValue")
local weightValue = weightIntValue.Value --the value that will increase by 10
Then, when you want it to count up from the weight, just do the line:
weightValue += 10
This will basically create a new variable with a starting value that of the weight. Then, adding 10 to that variable will mean you can have a variable to hold the weight + amount without editing the original value (which is the IntValue).