View difference between Paste ID: DQgNeYeb and gQvzh3Xb
SHOW: | | - or go back to the newest paste.
1-
local players = {"Shadow_67130", "batword","AyoryII"}
1+
local players = {"Shadow_67130", "batword","AyoryII","Strahmdu60180"}
2
side = "bottom"
3
timeout = 5
4
char1 = "p"
5
char2 = "o"
6
char3 = "i"
7
8
os.pullEvent = os.pullEventRaw
9
10
11
redstone.setOutput(side , false)
12
13
14
function openPorte()
15
  redstone.setOutput(side , true)
16
  sleep(timeout)
17
  redstone.setOutput(side , false)
18
end
19
20
while true do
21
  event, playerName = os.pullEvent()
22
  if (event == "player") then
23
    print("Hello " .. playerName)
24
    for i=#players,1,-1 do
25
      if (players[i]==playerName) then
26
        openPorte()
27
      end
28
    end
29
  elseif (event == "char" and playerName==char1) then
30
    event, char= os.pullEvent("char")
31
    if (char == char2) then
32
      event, char= os.pullEvent("char")
33
      if (char == char3) then
34
        break
35
      else
36
        os.reboot()
37
      end
38
    else
39
      os.reboot()
40
    end
41
  end
42
end