local C=script.Parent.OpenSpectate local e=script.Parent.Frame local s=e.PlrName local B=e.Left local l=e.Right local A=workspace.CurrentCamera local E=1 local H=game.Players.LocalPlayer C.MouseButton1Click:Connect(function()if e.Visible==true then e.Visible=false s.Text=H.Name A.CameraSubject=H.Character.Humanoid E=1 else e.Visible=true s.Text=H.Name A.CameraSubject=H.Character.Humanoid E=1 end end)l.MouseButton1Click:Connect(function()local C=game.Players:GetPlayers()local e=#C E=E+1 if E>e then E=1 end A.CameraSubject=C[E].Character.Humanoid s.Text=C[E].Name end)B.MouseButton1Click:Connect(function()local C=game.Players:GetPlayers()local e=#C E=E-1 if E<1 then E=e end A.CameraSubject=C[E].Character.Humanoid s.Text=C[E].Name end)
--Thanks for using this script
--This script is made by Joriangames/Problox Studio Scripts
--Want to know how to use this? Watch my tutorial: https://youtu.be/T65gtxrukQg
local button = script.Parent.OpenSpectate
local frame = script.Parent.Frame
local title = frame.PlrName
local left = frame.Left
local right = frame.Right
local cam = workspace.CurrentCamera
local num = 1
local plr = game.Players.LocalPlayer

button.MouseButton1Click:Connect(function()
	if frame.Visible == true then
		frame.Visible = false
		title.Text = plr.Name
		cam.CameraSubject = plr.Character.Humanoid
		num = 1
	else
		frame.Visible = true
		title.Text = plr.Name
		cam.CameraSubject = plr.Character.Humanoid
		num = 1
	end
end)

right.MouseButton1Click:Connect(function()
	local players = game.Players:GetPlayers()
	local all = #players
	num = num + 1
	if num > all then
		num = 1
	end
	cam.CameraSubject = players[num].Character.Humanoid
	title.Text = players[num].Name
end)

left.MouseButton1Click:Connect(function()
	local players = game.Players:GetPlayers()
	local all = #players
	num = num - 1
	if num < 1 then
		num = all
	end
	cam.CameraSubject = players[num].Character.Humanoid
	title.Text = players[num].Name
end)
