Guest User

example

a guest
Dec 18th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. local GroupId = 2886609;
  2.  
  3. function checkOkToClick(name)
  4.     if game.Players[name]:IsInGroup(GroupId) then
  5.         return true;
  6.     end
  7.     return false;
  8. end
  9.  
  10. script.Parent.MouseClick:connect(function(PlrWhoClicked)
  11.     local human = PlrWhoClicked.Character.Humanoid.Parent:FindFirstChild("Humanoid");    
  12.     if (checkOkToClick(human.Parent.Name)) then  
  13.         local Door1 = script.Parent.Parent.Parent.LGate:GetChildren();
  14.         local Door2 = script.Parent.Parent.Parent.RGate:GetChildren();
  15.         for i,v in pairs(Door1) do
  16.             if v:IsA("BasePart") then
  17.                 v.Transparency = 1;
  18.                 v.CanCollide = false;
  19.                 wait(3);
  20.                 v.Transparency = 0;
  21.                 v.CanCollide = true;
  22.             end
  23.         end
  24.         for i,v in pairs(Door2) do
  25.             if v:IsA("BasePart") then
  26.                 v.Transparency = 1;
  27.                 v.CanCollide = false;
  28.                 wait(3);
  29.                 v.Transparency = 0;
  30.                 v.CanCollide = true;
  31.             end
  32.         end
  33.         local Door1OPEN = script.Parent.Parent.Parent.RGateOpen:GetChildren();
  34.         local Door2OPEN = script.Parent.Parent.Parent.LGateOpen:GetChildren();
  35.         for i,v in pairs(Door1OPEN) do
  36.             if v:IsA("BasePart") then
  37.                 v.Transparency = 1;
  38.                 v.CanCollide = false;
  39.                 wait(3);
  40.                 v.Transparency = 0;
  41.                 v.CanCollide = true;
  42.             end
  43.         end
  44.         for i,v in pairs(Door2OPEN) do
  45.             if v:IsA("BasePart") then
  46.                 v.Transparency = 1;
  47.                 v.CanCollide = false;
  48.                 wait(3);
  49.                 v.Transparency = 0;
  50.                 v.CanCollide = true;
  51.             end
  52.         end
  53.     end
  54. end)
Advertisement
Add Comment
Please, Sign In to add comment