Advertisement
4zx16

Group Only Door

Dec 30th, 2021
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || GROUP ONLY DOOR
  3. ]]
  4. local player = game:GetService('Players').LocalPlayer
  5. local id = 0
  6.  
  7. local function onTouched(hit)
  8.     local player = game.Players:GetPlayerFromCharacter(hit.Parent)
  9.    
  10.     if player ~= nil then
  11.         if player:IsInGroup(id) then
  12.             script.Parent.Transparency = 0.8
  13.             script.Parent.CanCollide = false
  14.             wait(1)
  15.             script.Parent.Transparency = 0.5
  16.             script.Parent.CanCollide = true
  17.         else
  18.             player.Character:BreakJoints()
  19.         end
  20.     end
  21. end
  22. script.Parent.Touched:Connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement