Guest User

Untitled

a guest
Feb 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. print("Entry doors activated")
  2. s1 = false
  3. s2 = false
  4. s3 = false
  5. s4 = false
  6. s5 = false
  7.  
  8. sd = false
  9. function onChat(text,recep)
  10. finaltext=string.lower(text)
  11. s1 = false
  12. s2 = false
  13. s3 = false
  14. s4 = false
  15. s5 = false
  16. sX = false
  17.  
  18.  
  19.  
  20. if string.find(finaltext, "computer")~= nil then
  21. s1 = true
  22. if string.find(finaltext, "entry")~= nil then
  23. s2 = true
  24. end
  25. if string.find(finaltext, "doors")~= nil then
  26. s3 = true
  27. end
  28. if string.find(finaltext, "open")~= nil then
  29. s4 = true
  30. end
  31. if string.find(finaltext, "close")~= nil then
  32. s5 = true
  33. end
  34. end
  35.  
  36.  
  37. if s5 == true then
  38. sX = true
  39. end
  40.  
  41. if s1 == true and s2 == true and s3 == true and s4 == true and sX == false then
  42. UnlockDoors()
  43. elseif s1 == true and s2 == true and s3 == true and sX == true then
  44. LockDoors()
  45. end
  46.  
  47.  
  48. end
  49.  
  50.  
  51. function UnlockDoors()
  52. if sd == false then
  53. sd = true
  54. for i = 1,80 do
  55. script.Parent.R1.CFrame = script.Parent.R1.CFrame + Vector3.new(0.1, 0, 0)
  56. script.Parent.R2.CFrame = script.Parent.R2.CFrame + Vector3.new(0.1, 0, 0)
  57. script.Parent.L1.CFrame = script.Parent.L1.CFrame + Vector3.new(-0.10, 0, 0)
  58. script.Parent.L2.CFrame = script.Parent.L2.CFrame + Vector3.new(-0.10, 0, 0)
  59. wait()
  60. end
  61. end
  62. end
  63.  
  64. function LockDoors()
  65. if sd == true then
  66. sd = false
  67. for i = 1,80 do
  68. script.Parent.R1.CFrame = script.Parent.R1.CFrame + Vector3.new(-0.1, 0, 0)
  69. script.Parent.R2.CFrame = script.Parent.R2.CFrame + Vector3.new(-0.1, 0, 0)
  70. script.Parent.L1.CFrame = script.Parent.L1.CFrame + Vector3.new(0.1, 0, 0)
  71. script.Parent.L2.CFrame = script.Parent.L2.CFrame + Vector3.new(0.1, 0, 0)
  72. end
  73. end
  74. end
  75.  
  76. trains = {"jammy101101","Videaogame5","Rykarz","Hibobjoebill","SilentSwords","owen0202","supermansdog","Basketsgolba","drako72","Basketsgolba","AmazingAnt","Prometherion","dizzdazz4","Lucario1611","donut222","WIJPromotions","WIJManagement","cj10127","BallinOHehir21","lupine","yoshislayer","cymru792","cymru72","iRykorz","Daugion","Eeyore19718","JuHDude","Bloxmaster998144","shotsoon","Encladeus","piepiechris","Ultimateguy","Rovert10","dakotag11","STAInstructor","neo1014131","sk8rboy179","greekdagreat","bioniclehero","scaryblokhead","jack0800","LavaRocks894","ROBLOCKSuser","tallconnor123","KillerWarewolf","LORDORKY","wuppii","7035"}
  77.  
  78. function onPlayerEntered(newPlayer)
  79. for i = 1,#trains do
  80. if newPlayer.Name == trains[i] then
  81. newPlayer.Chatted:connect(function(text,recep) onChat(text,recep,player) end)
  82. end
  83. end
  84. end
  85.  
  86. game.Players.PlayerAdded:connect(onPlayerEntered)
Add Comment
Please, Sign In to add comment