The localscript works fine in solo, but online it says that 'activCamNo' does not exist. I'm confuzzled.
local p= script.Parent.Parent.Parent --game.Players.LocalPlayer
local char= p.Character
local cam= workspace.CurrentCamera
local camList= {
workspace.Cam1.Viewpoint,
workspace.Cam2.Viewpoint,
workspace.Cam3.Viewpoint
}
local activCam= 1
local activCamNo= Instance.new("IntConstrainedValue")
activCamNo.Name= "CamNo"
activCamNo.Parent= script.Parent
active= false
function checkCamNo()
activCamNo.MaxValue= #camList
activCamNo.MinValue= 0
if activCamNo.Value== 0 then
active= false
activCam= char.Humanoid
elseif activCamNo.Value~= 0 then
active= true
activCam= camList[activCamNo.Value]
end
end
checkCamNo()
game:GetService('RunService').Stepped:connect(function()
checkCamNo()
if active== false then
cam.CameraType= "Custom"
char.Humanoid.WalkSpeed= 10
elseif active== true then
cam.CameraType = 'Scriptable'
cam.CoordinateFrame = CFrame.new(activCam.Position, CFrame.new(activCam.CFrame * Vector3.new(0,0,-1)).p)
char.Humanoid.WalkSpeed= 0
else
end
end)

2 comments
Try adding "repeat wait until activeCamNo ~= nil" before line 15 (without quotes.)
Ah, thanks :)