How to use math operations from type object?

How would I achieve a math operation from a type object? I want to be able to boost the damage dependent on it’s dmgboost.

type CombatProperties = {
	iframes: boolean,
	damage: integer,
	dmgboost: integer
}

--Properties
function combatSystem:Create(): CombatProperties
	return {
		iframes = false,
		damage = 1,
        dmgboost = 1
	}
end

How would I multiply the damage by the dmgboost? This is a module script.

You’d have to set it after you called the function

Could I have an example? Doing something like

combatSystem.damage = combatSystem.damage * combatSystem.dmgboost

Would just throw an error.

What’s the error message in the output?

attempt to perform arithmetic (mul) on nil 

As well as

Requested module experienced an error while loading

Do you have ‘integer’ defined as a type? It’s not an actual type in Roblox

And as a follow up, when I tried to recreate the code, it worked without any issues, assuming this was the correct setup for it.

--ModuleScript
local CombatSystem = {}

type CombatProperties = {
	iframes: boolean,
	damage: integer,
	dmgboost: integer
}

function CombatSystem:Create() : CombatProperties
	return {
		iframes = false,
		damage = 1,
		dmgboost = 2
	}
end

return CombatSystem
--Test script I used
local x = require(script.Parent);
local y = x:Create();

y.damage *= y.dmgboost;

I’m trying to make it work in a way in which if the dmgboost is something like 2, it multiples it by the damage throughout multiple scripts. I might be doing something incorrect here.

Can you show me the script that threw an error?

I figured out the problem, but nonetheless still have another problem with making it global

I’d just make another property called “baseDamage” or something like that to keep track of what it originally was.