SHOW:
|
|
- or go back to the newest paste.
1 | --Comma-separated list of players allowed to turn | |
2 | --the mffs system on/off: | |
3 | - | plrs={"sploders101","Gman_____","_Sam_55"} |
3 | + | plrs={"Hexlen","example"} |
4 | --Side with redstone torch attached: | |
5 | - | side="back" |
5 | + | side="top" |
6 | --Side with chatbox peripheral: | |
7 | - | cb=peripheral.wrap("bottom") |
7 | + | cb=peripheral.wrap("left") |
8 | ||
9 | ||
10 | --Programming | |
11 | while true do | |
12 | _,plrname,msg=os.pullEvent("chat") | |
13 | plrallowed=false | |
14 | for k,v in ipairs(plrs) do | |
15 | if plrname==plrs[k] then | |
16 | plrallowed=true | |
17 | end | |
18 | end | |
19 | if plrallowed then | |
20 | if string.lower(msg)=="$mffs on" then | |
21 | rs.setOutput(side,false) | |
22 | cb.say(plrname..", your mffs is now on") | |
23 | elseif string.lower(msg)=="$mffs off" then | |
24 | rs.setOutput(side,true) | |
25 | cb.say(plrname..", your mffs is now off") | |
26 | end | |
27 | end | |
28 | end |