Advertisement
Gerard_games

Untitled

May 11th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. function idToName(Id)
  2. for z,x in pairs(game.Players:GetChildren()) do
  3. if x.UserId == tonumber(Id) then
  4. return x.Name
  5. end
  6. end
  7. end
  8.  
  9. function NameToid(Name)
  10. for z,x in pairs(game.Players:GetChildren()) do
  11. if x.Name == Name then
  12. return x.UserId
  13. end
  14. end
  15. end
  16.  
  17. local WhitelistedVisitAccess = {}
  18. local WhitelistedBuildAccess = {}
  19.  
  20. function traccAccess(TrACCIsland)
  21. TrACCIsland:WaitForChild("AccessVisit").ChildAdded:connect(function(Part)
  22. if Part.Name == tostring(game.Players.LocalPlayer.UserId) then
  23. Vistusername = idToName(Part.Parent.UserId.Value)
  24. table.insert(WhitelistedVisitAccess, Vistusername)
  25. end
  26. end)
  27.  
  28. TrACCIsland:WaitForChild("AccessVisit").ChildRemoved:connect(function(Part)
  29. if Part.Name == game.Players.LocalPlayer.UserId then
  30. local Count = 0
  31. for n,m in pairs(WhitelistedVisitAccess) do
  32. Count = Count + 1
  33. if NameToid(m) == idToName(Part.Parent.UserId) then
  34. table.remove(WhitelistedVisitAccess, Count)
  35. end
  36. end
  37. end
  38. end)
  39. TrACCIsland:WaitForChild("AccessBuild").ChildAdded:connect(function(Part)
  40. if Part.Name == tostring(game.Players.LocalPlayer.UserId) then
  41. Vistusername = idToName(Part.Parent.UserId.Value)
  42. table.insert(WhitelistedBuildAccess, Vistusername)
  43. end
  44. end)
  45.  
  46. TrACCIsland:WaitForChild("AccessBuild").ChildRemoved:connect(function(Part)
  47. if Part.Name == game.Players.LocalPlayer.UserId then
  48. local Count = 0
  49. for n,m in pairs(WhitelistedBuildAccess) do
  50. Count = Count + 1
  51. if NameToid(m) == idToName(Part.Parent.UserId) then
  52. table.remove(WhitelistedBuildAccess, Count)
  53. end
  54. end
  55. end
  56. end)
  57. end
  58.  
  59. for qq,ww in pairs(game:GetService("Workspace").Islands:GetChildren()) do
  60. traccAccess(ww)
  61. end
  62. game:GetService("Workspace").Islands.ChildAdded:connect(function(qweasdzxcrtyfghvbnuiojklm)
  63. traccAccess(qweasdzxcrtyfghvbnuiojklm)
  64. end)
  65.  
  66. local VisitDropdown = MiscWindow:Dropdown("Visit Access", {
  67. flag = "WOWYouCanVisit";
  68. list = WhitelistedVisitAccess;
  69. }, function(new)
  70. warn("WOW YOU CAN VISIT,", new)
  71. end)
  72.  
  73. local BLDDropdown = MiscWindow:Dropdown("Build Access", {
  74. flag = "WOWYouCanBUILD";
  75. list = WhitelistedBuildAccess;
  76. }, function(new)
  77. warn("WOW YOU CAN BUILD,", new)
  78. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement