Advertisement
OEAgamer1

padlock System in Roblox Studio

Apr 8th, 2024
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local door = workspace.FirstBox
  2. local GroupId = -- your group id
  3. local MinRank = -- min rank the player needs
  4.  
  5. game.Players.PlayerAdded:Connect(function(player)
  6.     player.Chatted:Connect(function(msg)
  7.         if player:GetRankInGroup(GroupId) >= MinRank then
  8.         for i,v in pairs(door:GetChildren()) do
  9.             if string.sub(msg,1,6) == "/lock1" and v:IsA("Part") then
  10.                 v.CanCollide = true
  11.                 v.Transparency = .8
  12.             elseif string.sub(msg,1,8) == "/unlock1" and v:IsA("Part") then
  13.                 v.CanCollide = false
  14.                 v.Transparency = 1
  15.             end
  16.         end            
  17.     end
  18.     end)
  19. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement