Posted 30 April 2015 - 03:51 PM
I have been fooling around with this code for a while and it just won't work. I have a feeling I'm missing one very important thing.
I've tried Google searches on how to use Peripheral++ Player Sensors but I can never get any good results :(/>
Here's the code:
Any help on making this work would be appreciated!
I've tried Google searches on how to use Peripheral++ Player Sensors but I can never get any good results :(/>
Here's the code:
term.clear()
term.setCursorPos(1,1)
--os.loadAPI("/disk/sapi")
oldPull = os.pullEvent
os.pullEvent = os.pullEventRaw
owner = "Ninja8370"
c = peripheral.wrap("top")
while true do
term.clear()
term.setCursorPos(1,1)
a = c.getNearbyPlayers(4)
intruder = false
for i = 1, #a do
if a[i].players ~= owner then
intruder = true
elseif a[i].players == owner and intruder == false then
rs.setOutput("right",true)
sleep(4)
rs.setOutput("right",false)
intruder = false
end
end
sleep(.5)
end
os.pullEvent = oldPull
Any help on making this work would be appreciated!
Edited on 30 April 2015 - 01:53 PM