IntValue value remains the same after multiplying or dividing

this is very weird

all the prints run, the starting value of damageTweak is 1, so it should be 1.1, but it isn’t?

-- loop through gameplay values to find the intvalue
	for _, value: IntValue in gameplayValues:GetDescendants() do
		if value.Name ~= assignedValue then continue end
		
		local traitBuff: number 		
		for i, value in traitStats[trait] do
			if typeof(value) == "number" then
				traitBuff = value
				break
			end
		end
		
		warn("Applying " .. trait .. " to " .. value.Name .. " with buff value of " .. traitBuff)
		if traitStats[trait].isMultiply then
			if remove then
				value.Value /= traitBuff
				warn(value.Value)
			else
				value.Value *= traitBuff
				warn(value.Value)
				warn(value.Parent)
				warn(value.Parent.Parent)
				warn(value.Parent.Parent.Parent)
			end
		else
			if remove then
				value.Value -= traitBuff
			else
				value.Value += traitBuff
			end
		end	
	end

image

i tested this further

any multiplication below 1.5 will result in the number being 1, why??

Because you are using int values. Integers are only whole numbers and not decimals. Use number values instead.

2 Likes

oh,

i never knew about the existence of NumberValues, so i just assumed that IntValues can store decimal numbers (idiotic i know)

bruh thanks :sob:

It’s in the name. “Integer” meaning any number that is not a decimal, both positive and negative.

i’m aware, but i didn’t know any other way to store numbers other than IntValues, so i just assumed roblox supports decimals in integers (Which would make them floats?)