Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local URLPrefix = "rbxassetid://"
- local Locations = {"Your House Floor 2","Your House Floor 1","Loopu Town","Lab","Route 1"}
- local Player = game.Players.LocalPlayer
- local Backpack = Player.Backpack
- local Stats = Player:WaitForChild("Stats")
- local CurrentLocation = Stats:WaitForChild("CurrentLocation")
- local RS = game.ReplicatedStorage
- local Modules = RS:WaitForChild("Modules")
- local Utilities = require(Modules:WaitForChild("Utilities"))
- local PlayerGui = script.Parent
- local MusicFolder = PlayerGui:WaitForChild("Music")
- local function DisplayPlayers2(Player,Transparency)
- local Character = Player.Character or Player.CharacterAdded:wait()
- local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
- local Active = false
- for _,Players in pairs(game.Players:GetPlayers()) do
- if Players ~= Player then
- local Characters = Players.Character or Players.CharacterAdded:wait()
- local function Recurse(Item)
- if Item.Name == "HumanoidRootPart" then
- Item.Transparency = 1 -- Always keep this as 1.
- elseif Item:IsA("BasePart") or Item.ClassName == "MeshPart" then
- Item.Transparency = Transparency
- elseif Item:IsA("Accoutrement") then
- Item:WaitForChild("Handle").Transparency = Transparency
- elseif Item:IsA("FaceInstance") then
- Item.Transparency = Transparency
- end
- for _, Child in pairs(Item:GetChildren()) do
- Recurse(Child)
- end
- for _, Part in pairs(Characters:GetChildren()) do
- Recurse(Part)
- end
- end
- elseif Active == true then
- for _, Player in pairs(game.Players:GetPlayers()) do
- if Player ~= game.Players.LocalPlayer then
- local Character = Player.Character or Player.CharacterAdded:Wait()
- local function Recurse(Item)
- if Item.Name == "HumanoidRootPart" then
- Item.Transparency = 1
- elseif Item:IsA("BasePart") or Item.ClassName == "MeshPart" then
- Item.Transparency = 0
- elseif Item:IsA("Accoutrement") then
- Item.Handle.Transparency = 0
- elseif Item:IsA("FaceInstance") then
- Item.Transparency = 0
- end
- for _, Child in pairs(Item:GetChildren()) do
- Recurse(Child)
- end
- end
- for _, Part in pairs(Character:GetChildren()) do
- Recurse(Part)
- end
- end
- end
- end
- end
- end
- local function DisplayPlayers(CurrentLocation)
- if CurrentLocation.Value == Locations[1] then -- Your House Floor 2
- local Transparency = 1
- game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,Transparency)
- end)
- game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,0)
- end)
- DisplayPlayers2(Player,Transparency)
- elseif CurrentLocation.Value == Locations[2] then -- Your House Floor 1
- local Transparency = 1
- game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,Transparency)
- end)
- game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,0)
- end)
- DisplayPlayers2(Player,Transparency)
- elseif CurrentLocation.Value == Locations[3] then -- Loopu Town
- local Transparency = 0
- game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,Transparency)
- end)
- game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,0)
- end)
- DisplayPlayers2(Player,Transparency)
- elseif CurrentLocation.Value == Locations[4] then -- Lab
- local Transparency = 1
- game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,Transparency)
- end)
- game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,0)
- end)
- DisplayPlayers2(Player,Transparency)
- elseif CurrentLocation.Value == Locations[5] then -- Route 1
- local Transparency = 0
- game.ReplicatedStorage.Update_Characters.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,Transparency)
- end)
- game.ReplicatedStorage.Disable_Invisibility.OnClientEvent:Connect(function()
- DisplayPlayers2(Player,0)
- end)
- DisplayPlayers2(Player,Transparency)
- end
- end
- Utilities.GetLocationMusic(Player,MusicFolder)
- Utilities.GetLocationPosition(Player)
- Utilities.GetLocationCameraManipulation(Player,Backpack)
- DisplayPlayers(CurrentLocation)
- CurrentLocation.Changed:Connect(function()
- Utilities.GetLocationMusic(Player,MusicFolder)
- Utilities.GetLocationPosition(Player)
- Utilities.GetLocationCameraManipulation(Player,Backpack)
- DisplayPlayers(CurrentLocation)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement