Can someone fix this camera script?
local debounce = false
local cam = game.Workspace.CurrentCamera
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if human == nil then return end
if debounce == false then
debounce = true
cam.CameraType = "Scriptable"
cam.CoordinateFrame = CFrame.new(
(script.Parent.CFrame * CFrame.new(0,script.Parent.Size.Z/2,0)).p,
(script.Parent.CFrame * CFrame.new(0,-script.Parent.Size.Z/2,0)).p
)
cam.Focus = CFrame.new(script.Parent.Position)
wait(10)
debounce = false
end
end
script.Parent.Touched:connect(onTouch)