Posted 12 December 2015 - 08:42 PM
Im getting an error on line 25 thats states, Incorrect arguments! Enter a boolean or an Integer 0-15.
local Emitters = {}
local EmitterCount = 0
local DefenseScreen = {"io_1", "io_2"}
local DefenseCount = 1
local State = { ... }
local Active = nil
if State[1] == "Defense_on" then
Active = true
print(Active)
defense(Active)
elseif State[1] == "Defense_off" then
Active = false
defense()
else
end
print(Active)
function defense(Active)
i = 1
print("Defense Screens Activated.")
while i <= DefenseCount do
Emitter = peripheral.wrap(DefenseScreen[i])
Emitter.setOutput(Active)
i = i + 1
end
end