Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1.  
  2. local URLPrefix = "rbxassetid://"
  3. local Locations = {"Your House Floor 2","Your House Floor 1","Loopu Town","Lab","Route 1"}
  4.  
  5.  
  6. local Player = game.Players.LocalPlayer
  7. local Backpack = Player.Backpack
  8. local Stats = Player:WaitForChild("Stats")
  9. local CurrentLocation = Stats:WaitForChild("CurrentLocation")
  10. local RS = game.ReplicatedStorage
  11. local Modules = RS:WaitForChild("Modules")
  12. local Utilities = require(Modules:WaitForChild("Utilities"))
  13. local PlayerGui = script.Parent
  14. local MusicFolder = PlayerGui:WaitForChild("Music")
  15.  
  16. local function DisplayPlayers2(Player,Transparency)
  17. local Character = Player.Character or Player.CharacterAdded:wait()
  18. local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  19. local Active = false
  20. for _,Players in pairs(game.Players:GetPlayers()) do
  21. if Players ~= Player then
  22. local Characters = Players.Character or Players.CharacterAdded:wait()
  23. local function Recurse(Item)
  24. if Item.Name == "HumanoidRootPart" then
  25. Item.Transparency = 1 -- Always keep this as 1.
  26. elseif Item:IsA("BasePart") or Item.ClassName == "MeshPart" then
  27. Item.Transparency = Transparency
  28. elseif Item:IsA("Accoutrement") then
  29. Item:WaitForChild("Handle").Transparency = Transparency
  30. elseif Item:IsA("FaceInstance") then
  31. Item.Transparency = Transparency
  32. end
  33. for _, Child in pairs(Item:GetChildren()) do
  34. Recurse(Child)
  35. end
  36. for _, Part in pairs(Characters:GetChildren()) do
  37. Recurse(Part)
  38. end
  39. end
  40. elseif Active == true then
  41. for _, Player in pairs(game.Players:GetPlayers()) do
  42. if Player ~= game.Players.LocalPlayer then
  43. local Character = Player.Character or Player.CharacterAdded:Wait()
  44. local function Recurse(Item)
  45. if Item.Name == "HumanoidRootPart" then
  46. Item.Transparency = 1
  47. elseif Item:IsA("BasePart") or Item.ClassName == "MeshPart" then
  48. Item.Transparency = 0
  49. elseif Item:IsA("Accoutrement") then
  50. Item.Handle.Transparency = 0
  51. elseif Item:IsA("FaceInstance") then
  52. Item.Transparency = 0
  53. end
  54. for _, Child in pairs(Item:GetChildren()) do
  55. Recurse(Child)
  56. end
  57. end
  58. for _, Part in pairs(Character:GetChildren()) do
  59. Recurse(Part)
  60. end
  61. end
  62. end
  63. end
  64. end
  65. end
  66.  
  67. local function DisplayPlayers(CurrentLocation)
  68. if CurrentLocation.Value == Locations[1] then -- Your House Floor 2
  69. local Transparency = 1
  70. game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
  71. DisplayPlayers2(Player,Transparency)
  72. end)
  73. game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
  74. DisplayPlayers2(Player,0)
  75. end)
  76. DisplayPlayers2(Player,Transparency)
  77.  
  78. elseif CurrentLocation.Value == Locations[2] then -- Your House Floor 1
  79. local Transparency = 1
  80. game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
  81. DisplayPlayers2(Player,Transparency)
  82. end)
  83. game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
  84. DisplayPlayers2(Player,0)
  85. end)
  86. DisplayPlayers2(Player,Transparency)
  87.  
  88. elseif CurrentLocation.Value == Locations[3] then -- Loopu Town
  89. local Transparency = 0
  90. game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
  91. DisplayPlayers2(Player,Transparency)
  92. end)
  93. game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
  94. DisplayPlayers2(Player,0)
  95. end)
  96. DisplayPlayers2(Player,Transparency)
  97.  
  98. elseif CurrentLocation.Value == Locations[4] then -- Lab
  99. local Transparency = 1
  100. game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
  101. DisplayPlayers2(Player,Transparency)
  102. end)
  103. game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
  104. DisplayPlayers2(Player,0)
  105. end)
  106. DisplayPlayers2(Player,Transparency)
  107.  
  108. elseif CurrentLocation.Value == Locations[5] then -- Route 1
  109. local Transparency = 0
  110. game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
  111. DisplayPlayers2(Player,Transparency)
  112. end)
  113. game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
  114. DisplayPlayers2(Player,0)
  115. end)
  116. DisplayPlayers2(Player,Transparency)
  117. end
  118. end
  119.  
  120. Utilities.GetLocationMusic(Player,MusicFolder)
  121. Utilities.GetLocationPosition(Player)
  122. Utilities.GetLocationCameraManipulation(Player,Backpack)
  123. DisplayPlayers(CurrentLocation)
  124. CurrentLocation.Changed:Connect(function()
  125. Utilities.GetLocationMusic(Player,MusicFolder)
  126. Utilities.GetLocationPosition(Player)
  127. Utilities.GetLocationCameraManipulation(Player,Backpack)
  128. DisplayPlayers(CurrentLocation)
  129. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement