WolfGamesProgrammer

Untitled

Mar 29th, 2024
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | Source Code | 0 0
  1. function Open(plr)
  2.     local Owner = script.Parent.Parent.Owner.Value
  3.    
  4.     if Owner == plr.Name then
  5.         if script.Parent.CanCollide == true then
  6.             script.Parent.Transparency = 1
  7.             script.Parent.CanCollide = false
  8.             for _, i in pairs(script.Parent:GetChildren()) do
  9.                 if i.ClassName == "Decal" or i.ClassName == "Texture" then
  10.                     i.Transparency = 1
  11.                 end
  12.             end
  13.         else
  14.             script.Parent.Transparency = 0
  15.             script.Parent.CanCollide = true
  16.             for _, i in pairs(script.Parent:GetChildren()) do
  17.                 if i.ClassName == "Decal" or i.ClassName == "Texture" then
  18.                     i.Transparency = 0
  19.                 end
  20.             end
  21.         end
  22.     end
  23. end
  24. script.Parent.ClickDetector.MouseClick:Connect(Open)
Advertisement
Add Comment
Please, Sign In to add comment