so im trying to make security cameras one camera is working but now i am trying to make it so you can browse through different cameras(they are 3 in a folder inn the workspace)
i tried using local cameras = game:GetService("Workspace").cams:GetChildren()
but the list is empty
i tried looking in the dev hub but i cant find exactly what i want, i found some things with the same issue but the solution was not working
the script is in starter gui (game.StarterGui.LocalScript
) and the folder is in the workspace (game.Workspace.cams
)
local rem = game:GetService("ReplicatedStorage").remote
local cam = game.Workspace.CurrentCamera
local curr_cam = 1
local cameras = game:GetService("Workspace").cams:GetChildren()
print(cameras)--debug(output:{})
print(game.Workspace.cams:GetChildren())--debug(output:{})
rem.OnClientEvent:Connect(function()
print(#cameras)--debug(output:0)
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = workspace.cams["cam 1"].CFrame
workspace.keyboard.ProximityPrompt.Enabled = false
workspace["Modern Office Chair"].Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if workspace["Modern Office Chair"].Seat.Occupant ~= game:GetService("Players").LocalPlayer.Character.Humanoid then
cam.CameraType = Enum.CameraType.Custom
workspace.keyboard.ProximityPrompt.Enabled = false
end
end)
end)
thank you