Page 1 of 1

Increase the ATTACKPower

Posted: Fri Nov 20, 2015 12:51 am
by Emera Nova
So I'm attempting to work on a script that would check for the value of a counter and then set that value as an monsters attack power value. Listed below is my attempt to stab in the dark and figure out how to do it. It doesn't seem to like what I put in for the setattackpower value so gonna need to figure out how to get it to take in the counters value.

Code: Select all

function settehpower()
local x = counter_57.counter:getValue()
if findEntity("mummy_1") ~= nil then
	mummy_1.monster:setAttackPower(x)
end
end

Re: Increase the ATTACKPower

Posted: Fri Nov 20, 2015 12:55 am
by Emera Nova
xD tried this, this doesn't work either..

Code: Select all

function settehpower()
if findEntity("mummy_1") ~= nil then
mummy_1.monster:setAttackPower(counter_57.counter:getValue())
end
end

Re: Increase the ATTACKPower

Posted: Fri Nov 20, 2015 7:49 am
by petri
You're trying to set the monster's attack power but monsters don't have attack power. Instead the different attacks they have, have attack powers. For example, if you want to set mummy's basic attack's attack power:

Code: Select all

mummy_1.basicAttack:setAttackPower(100)

Re: Increase the ATTACKPower

Posted: Fri Nov 20, 2015 10:00 am
by Emera Nova
I was wondering if that was going to be an issue or not.. xD guess I'll try that later today once I'm back on grimrock working.