Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function idToName(Id)
- for z,x in pairs(game.Players:GetChildren()) do
- if x.UserId == tonumber(Id) then
- return x.Name
- end
- end
- end
- function NameToid(Name)
- for z,x in pairs(game.Players:GetChildren()) do
- if x.Name == Name then
- return x.UserId
- end
- end
- end
- local WhitelistedVisitAccess = {}
- local WhitelistedBuildAccess = {}
- function traccAccess(TrACCIsland)
- TrACCIsland:WaitForChild("AccessVisit").ChildAdded:connect(function(Part)
- if Part.Name == tostring(game.Players.LocalPlayer.UserId) then
- Vistusername = idToName(Part.Parent.UserId.Value)
- table.insert(WhitelistedVisitAccess, Vistusername)
- end
- end)
- TrACCIsland:WaitForChild("AccessVisit").ChildRemoved:connect(function(Part)
- if Part.Name == game.Players.LocalPlayer.UserId then
- local Count = 0
- for n,m in pairs(WhitelistedVisitAccess) do
- Count = Count + 1
- if NameToid(m) == idToName(Part.Parent.UserId) then
- table.remove(WhitelistedVisitAccess, Count)
- end
- end
- end
- end)
- TrACCIsland:WaitForChild("AccessBuild").ChildAdded:connect(function(Part)
- if Part.Name == tostring(game.Players.LocalPlayer.UserId) then
- Vistusername = idToName(Part.Parent.UserId.Value)
- table.insert(WhitelistedBuildAccess, Vistusername)
- end
- end)
- TrACCIsland:WaitForChild("AccessBuild").ChildRemoved:connect(function(Part)
- if Part.Name == game.Players.LocalPlayer.UserId then
- local Count = 0
- for n,m in pairs(WhitelistedBuildAccess) do
- Count = Count + 1
- if NameToid(m) == idToName(Part.Parent.UserId) then
- table.remove(WhitelistedBuildAccess, Count)
- end
- end
- end
- end)
- end
- for qq,ww in pairs(game:GetService("Workspace").Islands:GetChildren()) do
- traccAccess(ww)
- end
- game:GetService("Workspace").Islands.ChildAdded:connect(function(qweasdzxcrtyfghvbnuiojklm)
- traccAccess(qweasdzxcrtyfghvbnuiojklm)
- end)
- local VisitDropdown = MiscWindow:Dropdown("Visit Access", {
- flag = "WOWYouCanVisit";
- list = WhitelistedVisitAccess;
- }, function(new)
- warn("WOW YOU CAN VISIT,", new)
- end)
- local BLDDropdown = MiscWindow:Dropdown("Build Access", {
- flag = "WOWYouCanBUILD";
- list = WhitelistedBuildAccess;
- }, function(new)
- warn("WOW YOU CAN BUILD,", new)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement