Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.99 KB | None | 0 0
  1. local module = {}
  2.  
  3. local collidersParent = {
  4.     --LOBBY
  5.     workspace.LobbyPlate.Lobby.Home.Colliders,
  6.     workspace.LobbyPlate.Lobby.PowerUpShop.Colliders,
  7.     workspace.LobbyPlate.Lobby.TauntShop.Colliders,
  8.     workspace.LobbyPlate.Lobby.ClothesShop.Colliders,
  9.     workspace.LobbyPlate.Lobby.PetShop.Colliders,
  10.     workspace.LobbyPlate.Lobby.MainCollider,
  11.     --Backyard
  12.     game.ReplicatedStorage.Rooms.Backyard.Root.MeshPart_1.Colliders,
  13.     game.ReplicatedStorage.Rooms.Backyard.Root.MeshPart_2.Colliders,
  14.     game.ReplicatedStorage.Rooms.Backyard.Root.MeshPart_3.Colliders,
  15.     game.ReplicatedStorage.Rooms.Backyard.Root.MeshPart_4.Colliders,
  16.     --Basement
  17.     game.ReplicatedStorage.Rooms.Basement.Root.Colliders,
  18.     --Bathroom
  19.     game.ReplicatedStorage.Rooms.Bathroom.Root.MeshPart_1.Colliders,
  20.     game.ReplicatedStorage.Rooms.Bathroom.Root.MeshPart_2.Colliders,
  21.     --Bedroom
  22.     game.ReplicatedStorage.Rooms.Bedroom.Root.Colliders,
  23.     --Girls Bedroom
  24.     game.ReplicatedStorage.Rooms.Girls_Bedroom.Root.Colliders,
  25.     --Kitchen
  26.     game.ReplicatedStorage.Rooms.Kitchen.Root.MeshPart_1.Colliders,
  27.     game.ReplicatedStorage.Rooms.Kitchen.Root.MeshPart_2.Colliders,
  28.     game.ReplicatedStorage.Rooms.Kitchen.Root.MeshPart_3.Colliders,
  29.     --Living Room
  30.     game.ReplicatedStorage.Rooms.Living_Room.Root.MeshPart_1.Colliders,
  31.     game.ReplicatedStorage.Rooms.Living_Room.Root.MeshPart_2.Colliders,
  32.     game.ReplicatedStorage.Rooms.Living_Room.Root.MeshPart_3.Colliders,
  33. }
  34.  
  35. local TAG_COLLIDERS = "Colliders"
  36.  
  37. local collectionService = game:GetService("CollectionService")
  38.  
  39. local function SetTagForChildren(object, parentToo)
  40.     if parentToo then
  41.         if object:IsA("Part") and object.Transparency > 0.96 then
  42.             collectionService:AddTag(object, TAG_COLLIDERS)
  43.             --print("Tagged: " .. object:GetFullName())
  44.         end
  45.     end
  46.  
  47.     for index, obj in ipairs(object:GetChildren()) do
  48.         SetTagForChildren(obj, true)
  49.     end
  50. end
  51.  
  52.  
  53.  
  54. module.SetCollidersTags = function()
  55.     for index, obj in ipairs(collidersParent) do
  56.         SetTagForChildren(obj, false)
  57.     end
  58. end
  59.  
  60. return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement