Advertisement
RoScripter

Command Door

Jul 29th, 2020
8,455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. local GroupId = 1234567 --REPLACE 1234567 WITH YOUR GROUP ID
  2. local MinimumRank = 254 --REPLACE 254 WITH THE MINIMUM RANK ID TO USE THE DOOR COMMANDS
  3. local Door = game.Workspace.Door
  4.  
  5. local TweenService = game:GetService("TweenService")
  6.  
  7. game.Players.PlayerAdded:Connect(function(Player)
  8.     Player.Chatted:Connect(function(Message)
  9.         if Player:GetRankInGroup(GroupId) >= MinimumRank then
  10.             if Message == "!OpenDoor" then
  11.                 local DoorTween = TweenService:Create(Door, TweenInfo.new(1), {Position = Door.Position + Vector3.new(0, Door.Size.Y, 0)})
  12.                 DoorTween:Play()
  13.             elseif Message == "!CloseDoor" then
  14.                 local DoorTween = TweenService:Create(Door, TweenInfo.new(1), {Position = Door.Position - Vector3.new(0, Door.Size.Y, 0)})
  15.                 DoorTween:Play()
  16.             end
  17.         end
  18.     end)
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement