Re: setResistances to remove resistances
Posted: Wed Apr 08, 2015 7:55 pm
When I just type in
it brings up an error code that says attempt to index local 'newResistances' (a nil value)
so I tried to fill in some of the stuff where it says type :S
Code: Select all
function changeResistances(monster,newResistances)
local damageTypes = {"fire","cold","shock","poison","physical","dispel"}
local resists = {}
for _,type in ipairs(damageTypes) do
resists[type] = newResistances[type] or monster:getResistance(type)
end
monster:setResistances(resists)
endso I tried to fill in some of the stuff where it says type :S