(For some reason ther is no 'alwaysActivate' option.)
Code: Select all
function deactivateForcefield()
if torch_holder_1.controller:getHasTorch() and
torch_holder_2.controller:getHasTorch() and
torch_holder_3.controller:getHasTorch() then
force_field_1.controller:activate()
else
force_field_1.controller:deactivate()
end
end
Code: Select all
function deactivateForcefield()
if torch_counter_1.counter:getValue() > 2 then --was >=
force_field_1.controller:activate()
elseif torch_counter_1.counter:getValue() < 1 then --was >=
force_field_1.controller:deactivate()
end
end
This script additionally requires a counter named "torch_counter_1"; initially set to zero (if all holders start with torches).