Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local o = script.Parent:WaitForChild("ViewportFrame")
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local function createBox(char, color)
- local box = Instance.new("Part")
- box.Size = Vector3.new(4,1,4)
- box.CFrame = char:WaitForChild("HumanoidRootPart").CFrame + Vector3.new(0,3,0)
- box.Color = color
- box.Anchored = true
- box.CanCollide = false
- box.Parent = o
- box.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- box.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- box.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
- box.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- box.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- box.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- end
- local function update()
- pcall(function()
- if character:WaitForChild("Humanoid").Health > 0 then
- o:ClearAllChildren()
- local cam = Instance.new("Camera")
- cam.Name = "ViewportCam"
- cam.Parent = o
- cam.CameraSubject = character:WaitForChild("Humanoid")
- cam.FieldOfView = workspace.CurrentCamera.FieldOfView
- cam.Focus = character:WaitForChild("Head").CFrame
- cam.CFrame = (character:WaitForChild("HumanoidRootPart").CFrame * CFrame.Angles(math.rad(-90),0,0)) + Vector3.new(0,20,0)
- o.CurrentCamera = cam
- for _,newObj in pairs(workspace:GetChildren()) do
- if newObj:IsA("Model") then
- if newObj:FindFirstChild("Humanoid") and newObj.Name == player.Name then
- local clone = newObj:Clone()
- clone.Parent = o
- createBox(newObj, Color3.fromRGB(0,255,0))
- elseif newObj:FindFirstChild("Humanoid") and newObj.Name ~= player.Name then
- local clone = newObj:Clone()
- clone.Parent = o
- createBox(newObj, Color3.fromRGB(255,0,0))
- else
- local clone = newObj:Clone()
- clone.Parent = o
- end
- elseif newObj:IsA("BasePart") then
- local clone = newObj:Clone()
- clone.Parent = o
- end
- end
- end
- end)
- end
- game:GetService("RunService").RenderStepped:Connect(function()
- update()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement