Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GroupId = 1234567 --REPLACE 1234567 WITH YOUR GROUP ID
- local MinimumRank = 254 --REPLACE 254 WITH THE MINIMUM RANK ID TO USE THE DOOR COMMANDS
- local Door = game.Workspace.Door
- local TweenService = game:GetService("TweenService")
- game.Players.PlayerAdded:Connect(function(Player)
- Player.Chatted:Connect(function(Message)
- if Player:GetRankInGroup(GroupId) >= MinimumRank then
- if Message == "!OpenDoor" then
- local DoorTween = TweenService:Create(Door, TweenInfo.new(1), {Position = Door.Position + Vector3.new(0, Door.Size.Y, 0)})
- DoorTween:Play()
- elseif Message == "!CloseDoor" then
- local DoorTween = TweenService:Create(Door, TweenInfo.new(1), {Position = Door.Position - Vector3.new(0, Door.Size.Y, 0)})
- DoorTween:Play()
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement