converting function() : int to a int

I think I understand what is happening but don’t know how to convert this to get around it ill post the code to make this easier to see what im saying.

function CalculateExpToLevel(): int{
		return _expToLevel * _levelMod;
	}
	function LevelUp(){
		_expToLevel = CalculateExpToLevel;
		_baseStat ++;
	}

for the second function I am tring to feed it a calculated number that returns as a int but its not seeing it as a int.

Don’t forget the brackets :wink:

CalculateExpToLevel ();

function CalculateExpToLevel () : int {
	return _expToLevel * _levelMod;
}

function LevelUp () {
	_expToLevel = CalculateExpToLevel();
	_baseStat ++;
}

–David

Can you cast in JS? I know that in C# you could do

function LevelUp()
{
    (int)_expToLevel = CalculateExpToLevel;
    _baseStat++;
}