Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function say(str)
- peripheral.find("command").setCommand("say "..str)
- peripheral.find("command").runCommand()
- end
- function msg(player,message)
- peripheral.find("command").setCommand("msg "..player.." "..message)
- peripheral.find("command").runCommand()
- end
- say("BaseControl Loaded! By: datcoder1208")
- while true do
- local event, side, player, message = os.pullEvent('chat_message')
- if player == "datcoder1208" and message == "BaseControl, open the door." then
- msg(player,"Opening doors...")
- rednet.open("bottom")
- rednet.broadcast("open")
- rednet.close("bottom")
- elseif player == "Gonow32" and message == "BaseControl, open the door." then
- msg(player,"Opening doors...")
- rednet.open("bottom")
- rednet.broadcast("open")
- rednet.close("bottom")
- elseif player == "datcoder1208" and message == "BaseControl, close the door." then
- msg(player,"Opening doors...")
- rednet.open("bottom")
- rednet.broadcast("close")
- rednet.close("bottom")
- elseif player == "Gonow32" and message == "BaseControl, close the door." then
- msg(player,"Opening doors...")
- rednet.open("bottom")
- rednet.broadcast("close")
- rednet.close("bottom")
- elseif player == "datcoder1208" and message == "BaseControl, activate security system." then
- msg(player,"SECURITY SYSTEM ARMED!")
- rednet.open("bottom")
- rednet.broadcast("securitysystemon")
- rednet.close("bottom")
- elseif player == "Gonow32" and message == "BaseControl, activate security system." then
- msg(player,"SECURITY SYSTEM ARMED!")
- rednet.open("bottom")
- rednet.broadcast("securitysystemon")
- rednet.close("bottom")
- elseif player == "datcoder1208" and message == "BaseControl, deactivate security system." then
- msg(player,"SECURITY SYSTEM DISARMED!")
- rednet.open("bottom")
- rednet.broadcast("securitysystemoff")
- rednet.close("bottom")
- elseif player == "Gonow32" and message == "BaseControl, deactivate security system." then
- msg(player,"SECURITY SYSTEM DISARMED!")
- rednet.open("bottom")
- rednet.broadcast("securitysystemoff")
- rednet.close("bottom")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement