Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --π± CatSpectator | V 1.0
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Camera = workspace.CurrentCamera
- local StarterGui = game:GetService("StarterGui")
- local playerGui = LocalPlayer:WaitForChild("PlayerGui")
- local char = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
- local oldGui = playerGui:FindFirstChild("CatSpectatorGUI")
- if oldGui then oldGui:Destroy() end
- local gui = Instance.new("ScreenGui", playerGui)
- gui.Name = "CatSpectatorGUI"
- gui.ResetOnSpawn = false
- local function makeCorner(parent, r)
- local u = Instance.new("UICorner")
- u.CornerRadius = r or UDim.new(0, 10)
- u.Parent = parent
- end
- local spectateBar = Instance.new("Frame", gui)
- spectateBar.Size = UDim2.new(0, 250, 0, 40)
- spectateBar.Position = UDim2.new(0.5, -125, 0, 10)
- spectateBar.BackgroundColor3 = Color3.fromRGB(255, 105, 180)
- spectateBar.Visible = false
- makeCorner(spectateBar)
- local spectateLabel = Instance.new("TextLabel", spectateBar)
- spectateLabel.Size = UDim2.new(1, -40, 1, 0)
- spectateLabel.Position = UDim2.new(0, 0, 0, 0)
- spectateLabel.BackgroundTransparency = 1
- spectateLabel.TextColor3 = Color3.new(1, 1, 1)
- spectateLabel.TextSize = 18
- spectateLabel.FontFace = Font.new("rbxassetid://12187375716", Enum.FontWeight.Bold, Enum.FontStyle.Normal)
- spectateLabel.Text = "[PlayerName]"
- local closeBtn = Instance.new("TextButton", spectateBar)
- closeBtn.Size = UDim2.new(0, 40, 1, 0)
- closeBtn.Position = UDim2.new(1, -40, 0, 0)
- closeBtn.BackgroundTransparency = 1
- closeBtn.TextColor3 = Color3.new(1, 1, 1)
- closeBtn.Text = "X"
- closeBtn.TextSize = 20
- closeBtn.FontFace = spectateLabel.FontFace
- local frame = Instance.new("Frame", gui)
- frame.Size = UDim2.new(0, 320, 0, 270)
- frame.Position = UDim2.new(0.5, -160, 0.5, -135)
- frame.BackgroundColor3 = Color3.fromRGB(255, 182, 193)
- frame.BorderSizePixel = 0
- frame.Active = true
- frame.Draggable = true
- makeCorner(frame)
- local title = Instance.new("TextLabel", frame)
- title.Size = UDim2.new(1, 0, 0, 40)
- title.Position = UDim2.new(0, 0, 0, 0)
- title.BackgroundColor3 = Color3.fromRGB(255, 105, 180)
- title.BorderSizePixel = 0
- title.Text = "Cat Spectator"
- title.TextColor3 = Color3.new(1, 1, 1)
- title.FontFace = spectateLabel.FontFace
- title.TextSize = 24
- makeCorner(title)
- local dropdown = Instance.new("TextButton", frame)
- dropdown.Size = UDim2.new(1, -20, 0, 35)
- dropdown.Position = UDim2.new(0, 10, 0, 50)
- dropdown.BackgroundColor3 = Color3.fromRGB(255, 105, 180)
- dropdown.TextColor3 = Color3.new(1, 1, 1)
- dropdown.Text = "Select a player"
- dropdown.FontFace = title.FontFace
- dropdown.TextSize = 20
- makeCorner(dropdown)
- local scroll = Instance.new("ScrollingFrame", frame)
- scroll.Size = UDim2.new(1, -20, 0, 90)
- scroll.Position = UDim2.new(0, 10, 0, 90)
- scroll.BackgroundColor3 = Color3.fromRGB(255, 182, 193)
- scroll.BorderSizePixel = 0
- scroll.ScrollBarThickness = 6
- scroll.Visible = false
- makeCorner(scroll)
- local layout = Instance.new("UIListLayout", scroll)
- layout.Padding = UDim.new(0, 5)
- local padding = Instance.new("UIPadding", scroll)
- padding.PaddingTop = UDim.new(0, 5)
- padding.PaddingBottom = UDim.new(0, 5)
- padding.PaddingLeft = UDim.new(0, 5)
- padding.PaddingRight = UDim.new(0, 5)
- local unspec = Instance.new("TextButton", frame)
- unspec.Size = UDim2.new(0.5, -15, 0, 30)
- unspec.Position = UDim2.new(0, 10, 1, -40)
- unspec.BackgroundColor3 = Color3.fromRGB(255, 105, 180)
- unspec.TextColor3 = Color3.new(1, 1, 1)
- unspec.Text = "Stop Spectating"
- unspec.FontFace = title.FontFace
- unspec.TextSize = 18
- makeCorner(unspec)
- local tp = Instance.new("TextButton", frame)
- tp.Size = UDim2.new(0.5, -15, 0, 30)
- tp.Position = UDim2.new(0.5, 5, 1, -40)
- tp.BackgroundColor3 = Color3.fromRGB(255, 105, 180)
- tp.TextColor3 = Color3.new(1, 1, 1)
- tp.Text = "Teleport"
- tp.FontFace = title.FontFace
- tp.TextSize = 18
- makeCorner(tp)
- local function resetCam()
- Camera.CameraSubject = LocalPlayer.Character:FindFirstChild("Humanoid")
- Camera.CameraType = Enum.CameraType.Custom
- dropdown.Text = "Select a player"
- spectateBar.Visible = false
- end
- unspec.MouseButton1Click:Connect(resetCam)
- closeBtn.MouseButton1Click:Connect(resetCam)
- dropdown.MouseButton1Click:Connect(function()
- scroll.Visible = not scroll.Visible
- end)
- local function update()
- for _, b in pairs(scroll:GetChildren()) do
- if b:IsA("TextButton") then
- b:Destroy()
- end
- end
- for _, plr in ipairs(Players:GetPlayers()) do
- if plr ~= LocalPlayer then
- local btn = Instance.new("TextButton", scroll)
- btn.Size = UDim2.new(1, 0, 0, 30)
- btn.BackgroundColor3 = Color3.fromRGB(255, 105, 180)
- btn.TextColor3 = Color3.new(1, 1, 1)
- btn.Text = plr.Name
- btn.FontFace = title.FontFace
- btn.TextSize = 18
- makeCorner(btn, UDim.new(0, 6))
- btn.MouseButton1Click:Connect(function()
- dropdown.Text = plr.Name
- scroll.Visible = false
- if plr.Character and plr.Character:FindFirstChild("Humanoid") then
- Camera.CameraSubject = plr.Character:FindFirstChild("Humanoid")
- Camera.CameraType = Enum.CameraType.Custom
- spectateLabel.Text = "["..plr.Name.."]"
- spectateBar.Visible = true
- else
- resetCam()
- end
- end)
- end
- end
- scroll.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 10)
- end
- tp.MouseButton1Click:Connect(function()
- local name = dropdown.Text
- local target = Players:FindFirstChild(name)
- if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") then
- local hrp = target.Character.HumanoidRootPart
- char:PivotTo(hrp.CFrame + Vector3.new(0, 5, 0))
- end
- end)
- Players.PlayerAdded:Connect(update)
- Players.PlayerRemoving:Connect(function(p)
- if dropdown.Text == p.Name then resetCam() end
- update()
- end)
- gui.Destroying:Connect(resetCam)
- update()
- -- Copy Discord link and show Roblox notification toast
- if setclipboard then
- setclipboard("https://discord.gg/qwacMcXA")
- end
- StarterGui:SetCore("SendNotification", {
- Title = "Discord link copied!";
- Text = "Discord has been copied please be kind and join itβ₯οΈ";
- Duration = 5;
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement