Been using a script to make certain camera angles and one line has an issue. Strangely the issue is only in game, not in test mode by myself, though going into a server makes it have an error in line 14 of this script. Here's the line
game.Players.LocalPlayer.Backpack.cameraScript:FindFirstChild("staticCam").Value = CFrame.new(script.Parent:FindFirstChild("position").CFrame.p,script.Parent:FindFirstChild("focus").CFrame.p)
Here's the entire script
script.Parent:FindFirstChild("zone").Transparency=1
script.Parent:FindFirstChild("position").Transparency=1
script.Parent:FindFirstChild("focus").Transparency=1
function onTouched(part)
print("touch camera")
if not game.Players:GetPlayerFromCharacter(part.Parent) then return end
local p=game.Players:GetPlayerFromCharacter(part.Parent)
while not p.Backpack:FindFirstChild("cameraScript") do
print("touchloop")
wait(2.0)
end
print("ended touch loop")
game.Players.LocalPlayer.Backpack.cameraScript:FindFirstChild("staticCam").Value = CFrame.new(script.Parent:FindFirstChild("position").CFrame.p,script.Parent:FindFirstChild("focus").CFrame.p)
end
script.Parent:FindFirstChild("zone").Touched:connect(onTouched)
