Everything in this script works fine, except the CFrame of the camera isn’t changing. When I change it manually while testing it works, but not here. (This is a LocalScript in StarterPlayerScripts)
local CurrentPositionX = 750
script.Create.Event:Connect(function (Item, Slot)
CurrentPositionX += 20
local Camera = Instance.new("Camera")
Camera.Name = "Camera"
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(Vector3.new(CurrentPositionX, 1000, 100), Vector3.new(CurrentPositionX, 1000, 100))
Camera.Parent = Slot
print(tostring(Camera.CFrame))
Item.CFrame = CFrame.new(Vector3.new(CurrentPositionX, 1000, 105), Vector3.new(CurrentPositionX + 5, 1000, 100))
Item.Parent = Slot.ViewportFrame
Slot.ViewportFrame.CurrentCamera = Camera
end)