I now have a different spectate system script but still how can I do it with streaming enabled?
local toggle = script.Parent.DeathScreen.Spectate
local frame = script.Parent.SpectateFrame
local previous = frame.Prev
local next = frame.Next
local status = frame.Status.CurrentPlayer
local camera = game.Workspace.CurrentCamera
local num = 1
status.Text = game.Players.LocalPlayer.Name
toggle.MouseButton1Click:Connect(function()
frame.Visible = not frame.Visible
script.Parent.DeathScreen.Visible = false
end)
previous.MouseButton1Click:Connect(function()
local players = game.Players:GetChildren()
local max = #players
num = num - 1
if num < 1 then
num = max
end
local player = players[num]
camera.CameraSubject = player.Character.Humanoid
status.Text = player.Name
end)
next.MouseButton1Click:Connect(function()
local players = game.Players:GetChildren()
local max = #players
num = num + 1
if num > max then
num = 1
end
local player = players[num]
camera.CameraSubject = player.Character.Humanoid
status.Text = player.Name
end)
frame.Changed:Connect(function()
if not frame.Visible then
camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
status.Text = game.Players.LocalPlayer.Name
end
end)