Help on the best way to know each time a player hits another thousand

My main idea here is in one leaderstats IntValue when it hits 1000 I want another value to become 1. This is because of the different currencies I have on the game I am currently working on. I feel there should be a way to check each time they hit 1000, 2000, 3000, etc. But I am not sure. Anyone got any ideas that could help me out? If so that would be very helpful.

Thanks, Sky

You can check if the Value divided by 1000 and then rounded down (math.floor) is greater than the old value with the same things done. Using GetPropertyChangedSignal works to detect changes since you’re doing leaderstats anyways.

2 Likes
if value%1000==0 then -- as 1000,2000,3000
    -- what you want to do.
end

he’s working with currencies if they go over 1000 say 1001 then that if statement would be false he would just need basic division.

local MathValue = math.floor(CurrentValue.Value/1000) --if the CurrentValue = 3567 this will return 3
if MathValue > 1 then --making sure its greater than 1
 --Subtract the currentvalues value by the MathValue*1000 ie
 CurrentValue.Value = CurrentValue.Value - (1000*MathValue) --This would take 3567 and turn it to 567
 --Add MathValue to the other currency ie 
 OtherCurrency.Value = OtherCurrency.Value + MathValue --assuming its 0 it would then add 3 to the other currency 
else
 print("doesn't have 1000+ currency")
end