I'm trying to make a spectate system where if you click a button it will move your camera to the player on that team.. It won't work though, and it warned me with
ActiveCameraController did not select a module
here's my code (it's all one local script)
local isSpectating = script.Parent.Parent:WaitForChild("IsSpectating")
local currentlySpectating = script.Parent.Parent:WaitForChild("CurrentlySpectating")
local character
script.Parent.MouseButton1Click:Connect(function()
for i,plr in pairs(game.Players:GetPlayers()) do
if plr then
if plr.Team == game.Teams.Telamon then
character = plr.Character
if character then
if plr.Team == game.Teams.Telamon then
local humanoid = character.Humanoid
currentlySpectating = plr.Name
end
end
end
end
end
isSpectating.Value = not isSpectating.Value
if isSpectating.Value == true then
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CameraSubject = character.Humanoid
end
if isSpectating.Value == false then
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
end
end)
