GeneralChaos
June 30th, 2011, 08:05
I'm trying to make a self-populating maximum number field. I'm about 15 years out of practice with anything remotely resembling programming, so have used a looted AC armor dex mod script.
I am hoping to get: Divide charisma score by 4, rounded down.
It's just returning 0.
<source>
<name>abilities.charisma.score</name>
</source>
<script>
function onSourceUpdate()
setValue(calculateSources());
end
function onSourceValue(source, sourcename)
local cha = source.getValue();
cha = cha / 4;
return cha;
end
</script>
I am hoping to get: Divide charisma score by 4, rounded down.
It's just returning 0.
<source>
<name>abilities.charisma.score</name>
</source>
<script>
function onSourceUpdate()
setValue(calculateSources());
end
function onSourceValue(source, sourcename)
local cha = source.getValue();
cha = cha / 4;
return cha;
end
</script>