I have a spectating script I made, but after you click on it it just says "close" but nothing else works? Here's the script:
local camera = game.Workspace.CurrentCamera local on = false script.Parent.MouseButton1Down:connect(function() if on == false then for i,v in pairs(game.Players:GetPlayers()) do if v.InGame.Value == true then camera.CameraType = "Attach" camera.CameraSubject = v.Character.Head script.Parent.Text = "Close" game.Players.LocalPlayer.PlayerGui.timer.Frame.Visible = false game.Players.LocalPlayer.PlayerGui.tp.TextButton.Visible = false game.Players.LocalPlayer.PlayerGui.spect.Frame.Visible = true on = true end end end if on == true then game.Players.LocalPlayer.PlayerGui.timer.Frame.Visible = true game.Players.LocalPlayer.PlayerGui.tp.TextButton.Visible = true game.Players.LocalPlayer.PlayerGui.spect.Frame.Visible = false camera.CameraType = "Custom" camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid end end)
This needs to be a local script in a player or character in order to get game.Workspace.CurrentCamera.
Based on the for i,v in pairs(game.Players:GetPlayers()) do
It appears your trying to do this for every player, but you're only using 1 camera.
Try making this a local script in a Player, and have this script so that you can do this to LocalPlayers separately.